Search code examples
rpackagedevtools

Bundling large .rda files with package


I am currently working on a package that I want to bundle some large .rda files with (hundreds of MB). If I use devtools::load_all(), my package takes forever to load since I included the files in the /data/ dir.

Is there a way to tell R to ignore the files in /data/ until I manually load them with data(), or am I better of just putting my data into a different directory?


Solution

  • How about you

    • create a directory inst/optionalData/ (or another suitable name)
    • add functions to load these data sets on demand

    as you can rely on

    system.files("optionalDate", "nameOfFile.rds", package="yourPackage")
    

    to find it.