R - where should I place RDA file - /R, /data, /inst/extdata?

前端 未结 2 1880
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 14:25

According to the \"Writing R Extensions\" manual, there are three directories where RDA files can be placed: /R, /data, /inst/extdata

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-14 15:00

    Starting with the manual for package writing strikes me as a good approach. The data/ directory looks like a good bet to me. As I recall, inst/extdata was suggested for non-R data sets or some such.

    The general rule still is that all directories below inst/ will be copied as-is; the data/ directory may be transformed. The manual will have details. So if you wanted it just for regression tests, you could use inst/testData (say) and, once the package is installed, you can use system.file("testData", package="yourPackageNameHere") to compute it.

提交回复
热议问题