I built a custom R package a while back that has served me well. And now I have a dataset that is configured that I have used across multiple projects. I put the script sample_pop.R
into /R
in my package and ran it successfully to save RData
df to the /data
directory.
When I went to re-build I got the following error:
Warning: file 'sample_pop.RData' has magic number 'X' Use of save versions prior to 2 is deprecated
Error in load(zfile, envir = envir) :
bad restore file magic number (file may be corrupted) -- no data loaded
Is this the right way to add data to an R package such that I can access my own data like I access diamonds
via ggplot
library?
library(ggplot2)
diamonds %>% head()