简体   繁体   中英

R Package Development - point to objects called by function

So I've got a function that loads an RData workspace and uses the data in a dataframe therein to perform some computation. At the moment I am putting everything into a package and my question is where I should put that workspace/the dataframe in the package and how I should modify my function to point to it.

Sec. 1.1.6 of the Writing R extensions manual describes exactly what you are looking for.

The data subdirectory is for data files, either to be made available via lazy-loading or for loading using data(). [...]

Data files can have one of three types as indicated by their extension: plain R code (.R or .r), tables (.tab, .txt, or .csv, see ?data for the file formats, and note that .csv is not the standard19 CSV format), or save() images (.RData or .rda). [...]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM