Skip to contents

This function updates the DESCRIPTION file of an R package to comply with openwashdata standards. It ensures that fields such as License, Language, Date, URL, and others are correctly specified. Existing URL and Config/Needs/website entries are preserved and merged with the openwashdata defaults. A CC BY 4.0 license is only set when the package does not have a license yet; an existing license is left untouched.

Usage

update_description(file = ".", github_user = NULL)

Arguments

file

Character. The file path to the DESCRIPTION file of the R package. Defaults to the current working directory.

github_user

Character. The URL of the GitHub user or organization that hosts the package, e.g., "https://github.com/yourorg". Defaults to the organisation of the repository already listed in URL, and to "https://github.com/openwashdata" when URL lists none.

Value

The path of the DESCRIPTION file, invisibly. The fields are updated in the file.

Details

DESCRIPTION is where the other functions read the facts of the package: the GitHub organisation and the repository from URL, the license from License, the people from Authors@R. The values that DESCRIPTION has no standard field for are written as Config/washr/ fields, and every other function reads them from there:

FieldUsed foropenwashdata default
Config/washr/fundingthe funding sentence in the sidebar of the sitethe ETH Board Open Research Data Program
Config/washr/analytics-domainthe Plausible analytics header of the siteopenwashdata.github.io
Config/washr/doi-providerthe DOI badge of the READMEzenodo
Config/washr/zenodo-communitythe community in .zenodo.jsonopenwashdata
Config/washr/brand-sourcethe GitHub repository use_brand() copies fromopenwashdata/brand
Config/washr/publisherthe publisher sentence in the footer of the site"Published by openwashdata, a project of Global Health Engineering at ETH Zurich." with links
Config/washr/homethe website of the organisation: the navbar link, the line under the README badges, the publisher url in the metadatahttps://openwashdata.org
Config/washr/catalogthe data catalogue named in the metadata (includedInDataCatalog)the Data page of openwashdata.org
Config/washr/communitythe text of the community block in the sidebar of the sitethe openwashdata block with the catalogue and the newsletter
Config/washr/versionthe washr version that last ran this function; also named in the footer of the site

A field that you edited is never overwritten, so a group other than openwashdata publishes with its own values by editing them. When the package moves to another organisation, whether github_user names it or URL was edited by hand, the fields that still hold the defaults of the old organisation follow; with github_user, the repository in URL is replaced as well. Set a field to none to switch its feature off. For a package under another GitHub organisation the funding, analytics, Zenodo community, brand, publisher, website, catalogue and community fields are written as none, because the openwashdata values would be wrong there. One more field is only ever written by hand: Config/washr/pages-domain, for a site that is not served from <organisation>.github.io.

See also

Before: setup_roxygen(). Next: update_metadata() for the schema.org metadata, then setup_readme().

Other metadata functions: update_citation(), update_metadata(), update_zenodo_json()

Examples

if (FALSE) { # \dontrun{
 # Update DESCRIPTION file in the current package
update_description()

 # Update DESCRIPTION file in a specific package
update_description(file = "path/to/your/package/DESCRIPTION")

 # Update DESCRIPTION file with a specific GitHub user
update_description(github_user = "https://github.com/yourusername")
} # }