11

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

Its really hard to decipher the best-practice from the manual. Could someone comment on when/why to place RDA files in each of these three directories.

Here's the specific cases I'm solving for:
I have 1 RDA file that will be used in function examples as well as in my test_that tests (which all live in inst/tests)

Marek
  • 49,472
  • 15
  • 99
  • 121
Suraj
  • 35,905
  • 47
  • 139
  • 250
  • no definitive answer from me - but you could go take a gander at some of your favorite packages and see where they put their RDA files to gain some inspiration – Chase May 24 '11 at 16:20

1 Answers1

12

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.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725