3 Package setup

Every R package needs a DESCRIPTION file, so we start by specifying this information:

usethis::create_package(
  path = ".",
  fields = list(
    Package = params$package_name,
    Version = "0.0.0.9006",
    Title = "An opinionated toolkit for harmonising data",
    Description = "conformr provides tools and workflows for converting data between classification standards, 
    and correcting discrepancies in reported and calculated statistics.",
    `Authors@R` = c(
      person(given = "Cynthia", family = "Huang", email = "cynthia@gmail.com", role = c("aut", "cre")),
      person(given = "Laura", family = "Puzzello", role = c("aut", "fnd"))
    ),
    `Config/testthat/edition` = 3
  )
)
usethis::use_mit_license(copyright_holder = "C. Huang")

Although it’s not required, it can be nice to add some package-level documentation. This is what will show up when someone types package?<your-package-name> in the console.

#' Validated Data Harmonisation
#'
#' Provides an opinionated toolkit for harmonising data from related nomenclature or classifications into a single consistent validated dataset. Offers safe-guards against common but often subtle data loss or corruption mistakes.
#' 
#' @docType package

3.1 Dependencies

## imports
usethis::use_package("dplyr")
usethis::use_package("rlang")
usethis::use_package("cli")

## suggests
## ✔ Adding 'dplyr' to Imports field in DESCRIPTION
## • Refer to functions with `dplyr::fun()`
## ✔ Adding 'rlang' to Imports field in DESCRIPTION
## • Refer to functions with `rlang::fun()`
## ✔ Adding 'cli' to Imports field in DESCRIPTION
## • Refer to functions with `cli::fun()`

3.2 Utilities

These functions are not exported.

#' Defaults for NULL values
#'
`%||%` <- function(x, y) if (is.null(x)) y else x