Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store multiple objects in sysdata.rda: R-package development

Tags:

r

devtools

I've just stumbled on the possibility to store internal package data in /R/sysdata.rda. However, I don't get how I should store multiple objects?

I can store one single object, but I would like to make many more available through sysdata.rda. I know it to be possible by looking at the Dichromats package, as shown on Hadley R packages website http://r-pkgs.had.co.nz/data.html.

I've tried the code below.

> devtools::use_data(data, data, internal = TRUE)
Saving data, data as sysdata.rda to C:\Users\USER\Documents\R\package/R

> devtools::use_data(data2, data2, internal = TRUE)
Error: sysdata.rda already exists in C:/Users/User/Documents/R/package/R. Use overwrite = TRUE to overwrite
In addition: Warning message: Saving duplicates only once: data2 
like image 836
uncool Avatar asked Jul 20 '16 10:07

uncool


1 Answers

It is as simple as seperating the different object by a comma.

For example

> devtools::use_data(data.frame1, data.frame2, internal = TRUE)
like image 183
uncool Avatar answered Oct 14 '22 15:10

uncool