I created an R package that contains several datasets in the data/ directory. The datasets are .RData files. When I run
devtools::load_all() and then try to pull up one of the datasets, called "nsw", with
data(nsw), it loads just fine into my environment. But when I install the package from Github using
devtools::install_github() and do the same thing,
data(nsw), I get this message:
Warning message: In data(nsw) : data set ‘nsw’ not found
It's the same with the other datasets in the package, not just nsw. And it's not just the
data() function: I can't access those data objects at all, with any other functions (e.g.
I went over to the Library directory and checked the folder for the installed package--the datasets show up, and there are no errors when I run
devtools::check() before building the package. I have properly documented the datasets in a data.R script, and
devtools::document() successfully generates an .Rd file for each dataset.
In the SO posts I linked above, other people had a similar issue to this one, and they fixed it by changing the file extensions of the datasets. Some sources say '.rda' is preferred, others say that '.RData' is preferred. I've tried '.Rda', '.rda', '.Rdata', and '.RData'--none of those file extensions fixes my problem.
One thing to note is that some of these data files are quite large. I wonder if that could be part of the problem? And yet, I'm not having any trouble installing the package from Github; the files seem to download just fine.
Does anyone know what might be wrong here?