I've written a small package that is useful for sharing functions and example data with colleagues, and I recently added a few more data files to it. The computer I was using when I did that was running R version 4.0.0. However, when I tried to use devtools to install that package from github onto a computer running R version 4.0.2, I get the following message:
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'LaurasHelpers/data/Candidates.RData'
I don't know what it means that my data are serialized. I haven't changed how I save things. Here's how I saved a data.frame called "MyData" to the "data" folder of my package:
save(MyData, "MyData.RData")
After seeing the initial answer to my post, I then tried
save(MyData, "MyData.RData", version = 2)
Next, I updated everything:
devtools::document()
devtools::build()
From git bash, I pushed my changes to my github repo. Then, back in RStudio, I did:
remove.packages("LaurasHelpers")
devtools::install_github(repo = "shirewoman2/LaurasHelpers")
But when I load my package, I still can't load certain data files into my workspace using data(MyData).
Two questions:
- Why are data files that I've saved using R 4.0.0 not able to be loaded in R 4.0.2? Both of those are more recent than R 3.5.0.
- How do I avoid this problem so that anyone who loads my package can open my pretty simple data set?