R CMD check and .RDa Data files

╄→гoц情女王★ 提交于 2019-12-11 05:28:26

问题


I have data files in the .RDa format under the data sub directory. But, the R CMD check command is not recognizing the load("test.RDa") command and its failing at this stage and gives the following error:

Warning in readChar(con, 5L, useBytes = TRUE) :  
cannot open compressed file 'test.RDa', probable reason 'No such file or directory'  
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection  
Calls: load -> readChar  
Execution halted  

Can you please let me know the reason? Should I give a path specifying from where to load?


回答1:


If you want to include data in your package, put it in mypkg/data/foo.rda and "load" it via data(foo). You should also create a mypkg/man/foo.Rd file to document the data.

Read more in the Data in packages section of Writing R Extensions.



来源:https://stackoverflow.com/questions/5293234/r-cmd-check-and-rda-data-files

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