24

This is likely an easy answer that's been answered numerous times. I just lack the terminology to search for the answer.

I'm creating a package. When the package loads I want to have instant access to the data sets.

So lets say DICTIONARY is a data set.

I want to be able to do DICTIONARY rather than data(DICTIONARY) to get it to load. How do I go about doing this?

Jeromy Anglim
  • 33,939
  • 30
  • 115
  • 173
Tyler Rinker
  • 108,132
  • 65
  • 322
  • 519
  • You should look at packages that succeed in making their datasets available in that manner. For example the MASS dataset Aids2 is available without using data(). – IRTFM Jun 05 '12 at 03:35

1 Answers1

33

From R-exts.pdf (online source):

The ‘data’ subdirectory is for data files, either to be made available via lazy-loading or for loading using data(). (The choice is made by the ‘LazyData’ field in the ‘DESCRIPTION’ file: the default is not to do so.)

Adding the following to the DESCRIPTION file should do it:

LazyData: true
Jaap
  • 81,064
  • 34
  • 182
  • 193
Dason
  • 60,663
  • 9
  • 131
  • 148