简体   繁体   中英

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?

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 .

使用devtools::use_data(your_data, overwrite = TRUE)将数据文件保存到data/文件夹,它应该可以工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM