What |
R objects for user |
R objects for functions |
Non-R objects for user |
Use case |
Data for testing; data package |
Funs need e.g. lookup table, external info |
Practice loading in data/interacting with external files |
Where to put it |
data/___.rda |
R/sysdata.rda |
inst/extdata/ |
File format |
Multiple .rda files |
Single .rda file, sysdata.rda |
Any format (usually not .rda). E.g. csv, xls, etc. |
How to make/store it |
usethis::use_data(my_pkg_data) |
usethis::use_data(this, that, internal = T) |
? |
Where to make it |
data-raw/___.R |
data-raw/___.R |
data-raw/___.R ? |
How do users access it? |
pkg::my_pkg_data or library(pkg); my_pkg_data |
They don’t. |
File paths? |
Lazy-loaded? |
If set in DESCRIPTION |
Always |
? |
Documented? |
Yes, in R/ |
No |
? |