Cheatsheet.md

Cheatsheet for building & updating the package

tl;dr

  1. copy&paste a function including the preceding roxygen comments (#')
  2. ~~hack the planet~~ modify as needed
    • if any, add not-yet imported packages to DESCRIPTION
  3. run devtools::document()
  4. build package by hitting ctrl/cmd + shift + B

Adding functions

Adding data

  1. in an interactive session, read-in data as usual
    • to rename data already present in the package, read it with the desired name and delete the file with the old name in data/
  2. run usethis::use_data(name_of_data) (e.g. usethis::use_data(mousetrack_typicality))
    • this will put the data as an .rda file - surprisingly again - into data/ and make it available by the name of the data-object
    • ideally (but not necessarily), some description of the data is provided in R/data.R; the one already present should suffice as an example on how that looks
    • when renaming data, remember to change the name provided in R/data.R as well
  3. run devtools::document() and afterwards build the package (ctrl/cmd + shift + B)


michael-franke/aida-package documentation built on Feb. 19, 2023, 11:51 p.m.