Skip to content

properly document dependencies, external functions, function exports #32

@atn38

Description

@atn38

Alina ran into some trouble with dependencies on Monday. We should be more carefully document dependencies in a way that would prompt user machines to stall or auto-install packages we depend on upon installation or loading of BLEdatatools. Imo best practices would be:

  1. Prefix any external functions with the double colon syntax, e.g. "readr::read_csv"
  2. Document the packages the external functions come from in the DESCRIPTION file, e.g.
Imports: 
    readr

A quick way to programmatically edit the DESCRIPTION file is to use usethis::use_package("readr").
If the external package is not on CRAN but Github, e.g. bleutils, use usethis::use_dev_package("bleutils", remotes = "BLE-LTER/bleutils" and the output DESCRIPTION would read:

Imports: 
    bleutils (>= 0.1.0)
Remotes: 
    BLE-LTER/bleutils
  1. Export BLEdatatools functions that we want to be user-facing (so, not the utility-functions) with the @export tag in the header, like so:
# cool useful metadata up here
#' @export

See commit 9939337 for an example of some cleaning up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions