inst and extdata folders in R Packaging

后端 未结 2 1998
感动是毒
感动是毒 2020-12-01 02:14

In the documentation, R suggests that raw data files (not Rdata nor Rda) should be placed in inst/extdata/

From the first paragraph in: http://cran.r-pr

2条回答
  •  余生分开走
    2020-12-01 02:29

    More useful than using file.path would be to use system.file. Once your package is installed, you can grab your file like so:

    fpath <- system.file("extdata", "my_raw_data.csv", package="my_package")
    

    fpath will now have the absolute path on your HD to the file.

提交回复
热议问题