0

I am working on an R package that I would like to submit to CRAN and have had issues with the size of the data, therefore I moved it into the extdata/data folder in order to use in my examples but I am getting fatal errors that are not allowing my package to pass the checks.

The GitHub repo

I've tried a few different solutions (i.e. system.file() & load(system.file())) which have not worked. The files are RData files.

#' load(system.file("extdata", "trueLabels.RData", package = "DWLS"))
&
#' system.file("extdata", "trueLabels.RData", package = "DWLS")

How can I use the data in the extdata/data folder in my @examples of the functions without encountering build errors?

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 27 '22 at 10:18

1 Answers1

0

The main problem is that your files will not be available for loading with system.file until the package is installed. So at build time the examples will not have them, only will be there when the package is available, devtools::load_all() does not do the trick.

load(system.file('extdata','<filename>.RData', package = 'DWLS')) is the way to go, in any case.

You can find more info here and here

I've seen in your repo that you try to get the data with download.file() but failed at check job. You can try to use tmpfile() as destination.

Adrià
  • 356
  • 2
  • 7