Every R package contains documentation describing the package to other uses and to manage dependencies and other settings. The two key documents are the README and DESCRIPTION files.
A readme file provides an overview of the package for users browsing on Github or CRAN (the R repository). Readme files are written in markdown, a lightweight language used to write documents. You can create a basic readme file called README.md
using:
use_readme_md()
Open this and add the details of your package.
The DESCRIPTION
file provides metadata about the package for R and CRAN. Here you can find a detailed explanation of what should be included. At a minimum you should add:
Note that the default package version will be 0.0.0.9000. Setting the version of your package is discussed in Releasing to Github.
There are many different licencing options. In this package we choose lgpl v3, but you can Cchose the licence that fits your use case. We can use usethat
to set the licence in the DESCRIPTION file:
use_lgpl_license()
✔ Adding 'LGPL (>= 3)' to License
✔ Writing 'LICENSE.md'
✔ Adding '^LICENSE\\.md$' to '.Rbuildignore'
When writing DataSHIELD packages, if you plan to submit your package to CRAN you should include an additional line indicating the source of the core DataSHIELD package, dsBaseClient
:
Additional_repositories: https://cran.obiba.org/