0

I'm trying include dataset in my r-package. So, I puted the .rda files in the folder /data. In my examples environment I loaded the dataset by the way:

load("~/mypackage/data/database.rda")

But, when I submited for CRAN, their reported the follows error:

Warning in readChar(con, 5L, useBytes = TRUE) : cannot open compressed file '/home/hornik/mypackage/data/database.rda', probable reason 'No such file or directory'

  • Does this [SO post](https://stackoverflow.com/questions/5293234/r-cmd-check-and-rda-data-files) help? The official document is Writing R Extensions, [section 1.1.6 Data in packages](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages). Also, is the package you submitted to CRAN really named `mypackage`? – Rui Barradas Jun 20 '20 at 17:24

1 Answers1

2

That error appears because your home folder (~/) is not included in the package. Try to use simple:

data(database)

You can see more details in the documentation.