How to manage and address supplementary data in R packages

200 views Asked by At

I'd like to have supplementary data in my R package. I know about LazyData: true in DESCRIPTION, but do not want to use it because the example data is quite large. So I created a dir "data" which holds two .RData files and a datalist, which I added using tools::add_datalist.

datalist
supA.RData
supB.RData

Furthermore, I am using roxygen2 to create a documentation - I want to document the .RData files, too. (I read somewhere, that this is even necessary.)

First question:

is it correct to document the two .RData files like:

#' Example data
#'
#' @format A data dable with 50000 rows and 670 variables:
"supA"

and add this to a .R file? (never export!!)

Second question: At the moment i can not use document(), because the two variables are unknown/not in global environment. There has to be a clean way of doing this, right?

I hope to find help here, Thank you!

EDIT: For now, I removed the documentation for supA and supB. Loading data by call of the function data("supA") works alright for now

0

There are 0 answers