[R-pkg-devel] Cache in vignette not working when checking a package

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Feb 2 03:38:48 CET 2021


On 1 February 2021 at 20:21, Jose Barrera wrote:
| Many thanks for your help Thierry but unfortunately I can't  see the link
| between your first reply and my issue (of course, that's my fault).

Thierry very gently (yet correctly) suggested to have the "cached" results as
"precomputed" artifacts in the package to not require any compution at all.
So write, for example, a data.frame df as
     saveRDS(df, "inst/cachedData/data.rds")
and then in your vignette retrieve it as
     df <- readRDS(system.file("cachedData", "data.rds", package="mypkg"))
replacing "mypkg" with your package name.

Cheers, Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list