Search code examples
rcsvpackagecran

ship directory of CSVs with R package


I have contributed several import functions to R package, which batch read in CSVs from specifically structured directories (such as this).

To give users an example, I'd like to ship such a directory structure of CSVs with the package. Since these are import functions, it obviously makes no sense to include the data as ready-made *.rda.

So I did this:

  1. add the directory (with subdirectories) ("keyneson") to inst/.
  2. document it with a keyneson.rd in man/ as if it were a normal *.rda dataset.

R CMD check passes without notes/warnings.

Is this ok? Will CRAN accept this? Is there a better way?


Solution

  • Jennifer Bryan suggested on twitter that I should use /inst/extdata (as @Dason suggested) and place an Rdata into /data/.

    She did the same for her package, which made it past CRAN.

    That's what I did, too, works fine. No complaints from R CMD check.