在提问之前,我承认这个问题的许多部分已经在其他堆栈中触及,并且我已经阅读了 Hadley Wickham 的实例和小插图部分,但我仍在努力解决我的警告。如果这个问题有点啰嗦,我很抱歉,我会尽力彻底。
\n\n我的问题涉及我的 package_tutorial。
\n\n我收到的第一个警告是:
\n\n> checking files in \xe2\x80\x98vignettes\xe2\x80\x99 ... WARNING\n Files in the \'vignettes\' directory but no files in \'inst/doc\':\n \xe2\x80\x98package_tutorial.Rmd\xe2\x80\x99, \xe2\x80\x98package_tutorial.pdf\xe2\x80\x99\n\nRun Code Online (Sandbox Code Playgroud)\n\n在 Hadley Wickham 的文档中,它指出“inst/docs:这是一个较旧的小插图约定,在现代包中应该避免。” 那么为什么 CMD 检查要求将小插图放在 inst/doc 文件夹中呢?我将概述问题末尾附近的小插图和 inst 文件夹中的内容。
\n\n我收到的下一个警告也是如此:
\n\n> checking package vignettes in \xe2\x80\x98inst/doc\xe2\x80\x99 ... WARNING\n dir.exists(dir) is not TRUE\n Package vignette without corresponding single PDF/HTML:\n \xe2\x80\x98package_tutorial.Rmd\xe2\x80\x99\nRun Code Online (Sandbox Code Playgroud)\n\n我没有 doc 文件夹,因为很明显 inst/doc 文件夹已过时。当我对 inst/doc 文件夹中的小插图进行 CMD 检查时,doc 文件夹将被删除。我知道这可能是重建过程的一部分。
\n\n可能有助于解决此问题的其他信息:
\n\n文件夹结构(仅适用于vignette和inst文件夹):
\n\n包 …
有人告诉我尝试使用vapply()而不是sapply()我的代码和函数。我sapply()经常使用,并且尝试使用它,vapply()但是我的一些功能sapply()用法相当复杂。
我在下面举一个例子,希望对使用vapply()而不是来重新生成相同结果提供一些指导sapply()。
> dput(head(df[1]))
structure(list(D1 = structure(c(WP1 = 47L, WP10 = 17L, WP103 = 21L,
WP108 = 23L, WP113 = 34L, WP116 = 79L), .Label = c(" 0.00",
" 0.57", " 10.00", "100.00", " 10.20", " 10.26", " 10.34", " 10.53",
" 10.87", " 11.11", " 11.36", " 11.48", " 11.54", " 11.76", " 11.94",
" 12.20", " 12.50", " 12.86", " 12.90", " 1.30", " …Run Code Online (Sandbox Code Playgroud)