简体   繁体   English

R CMD检查和.RDa数据文件

[英]R CMD check and .RDa Data files

I have data files in the .RDa format under the data sub directory. 我在数据子目录下有.RDa格式的数据文件。 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: 但是, R CMD check命令在此阶段无法识别load("test.RDa")命令及其失败,并给出以下错误:

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? 我应该指定从何处加载的路径?

If you want to include data in your package, put it in mypkg/data/foo.rda and "load" it via data(foo) . 如果要在包中包含数据,请将其放在mypkg/data/foo.rda ,然后通过data(foo) “加载”。 You should also create a mypkg/man/foo.Rd file to document the data. 您还应该创建一个mypkg/man/foo.Rd文件来记录数据。

Read more in the Data in packages section of Writing R Extensions . 在“ 编写R扩展”的“ 中的数据”部分中了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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