[R-pkg-devel] Can I put my small data-sets into one .rda file in my CRAN package?

Michael Dewey li@t@ @ending from dewey@myzen@co@uk
Fri Dec 7 16:20:40 CET 2018

Thanks to both Joris and Georgi for some helpful information. I was 
taken by Joris' aside that combining the data-sets makes more sense if 
they are conceptually related so I have decided to stick with separate 


On 05/12/2018 16:44, Georgi Boshnakov wrote:
> Further to Joris' email, the help page of data() is very informative.
> If the reason for wishing to combine the datasets together is so that they can be made available in a single command,
> an option might be to create an R source file which loads all datasets, thus giving this option without withdrawing the possibility for  loading the individual datasets.
> Georgi Boshnakov
> -----Original Message-----
> From: R-package-devel [mailto:r-package-devel-bounces using r-project.org] On Behalf Of Joris Meys
> Sent: 05 December 2018 16:22
> To: lists using dewey.myzen.co.uk
> Cc: R Package Development
> Subject: Re: [R-pkg-devel] Can I put my small data-sets into one .rda file in my CRAN package?
> Hi Michael,
> in the data() function you have to use the name of the rda file, not the
> name of the dataset you need.
> So say you have the datasets validity and data2 in a file called
> alldata.rda, you need to do:
> data(alldata)
> and that will make both validity and data2 available to the user.
> imho it only makes sense to combine data in one .rda file when they're also
> related (for example an dataset with species and the similarity matrix for
> those species).
> Hope this helps
> Cheers
> Joris
> On Wed, Dec 5, 2018 at 4:19 PM Michael Dewey <lists using dewey.myzen.co.uk>
> wrote:
>> At the moment my package (metap) has a number of small data-sets each as
>> a separate .rda file. It works fine. I thought it would be neater to put
>> them all into one file which I called data.rda (original choice of name
>> there).
>> Now when I do R CMD build metap
>> it fails when trying to build the vignette when that executes
>> data(validity)
>> where validity is contained in data.rda.
>> I cannot find anything in writing R extensions which explicitly forbids
>> this but equally nothing which explicitly permits it. Am I missing
>> something? Obviously this is not an important problem and as the title
>> says the solution should work on CRAN too.
>> --
>> Michael
>> http://www.dewey.myzen.co.uk/home.html
>> ______________________________________________
>> R-package-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel


More information about the R-package-devel mailing list