How to manage and address supplementary data in R packages

非 Y 不嫁゛ 提交于 2019-12-24 02:22:29

问题


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

来源:https://stackoverflow.com/questions/30696374/how-to-manage-and-address-supplementary-data-in-r-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!