hadley / r-pkgs

Building R packages
https://r-pkgs.org
Other
882 stars 627 forks source link

Clarify that internal data is always lazy-loaded #1027

Closed salim-b closed 1 year ago

salim-b commented 1 year ago

Cf. https://stackoverflow.com/questions/41269434/r-package-make-internal-data-not-lazy

jennybc commented 1 year ago

Interesting! I'm happy to merge but would feel even better if we had a reference that was more official, e.g. from the official R manuals. In the journey that brought you here, have you encountered any explicit statement about the laziness of internal data in official R docs?

salim-b commented 1 year ago

The only official information I could find is the R Manual which states:

Two exceptions are allowed: if the R subdirectory contains a file sysdata.rda (a saved image of one or more R objects: please use suitable compression as suggested by tools::resaveRdaFiles, and see also the SysDataCompression DESCRIPTION field.) this will be lazy-loaded into the namespace environment – this is intended for system datasets that are not intended to be user-accessible via data.

It doesn't explicitly say "always". But since no known means to disable lazy-loading of internal data seem to exist, it practically means "always", I guess.

jennybc commented 1 year ago

OK that's reassuring to find. Thanks!