Stefan F
Stefan F

Reputation: 2753

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?

Upvotes: 0

Views: 89

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368201

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.

Upvotes: 1

Related Questions