简体   繁体   English

如何解决R CMD check --as-cran中的错误,以使我的R程序包在CRAN上被接受?

[英]How do I fix errors from R CMD check --as-cran to get my R package accepted on CRAN?

Executive Summary 执行摘要

I need assistance to fix the errors as I attempt to create a manual for a new R package. 当我尝试为新的R包创建手册时,我需要协助来修复错误。 I have created an R package on my computer that I would like to distribute. 我已经在我的计算机上创建了一个R软件包,我希望将其分发。 At the moment, the package is available as a repository on GitHub ( http://www.github.com/greenspb/poker ), but I want to contribute it to the Comprehensive R Archive Network. 目前,该软件包可作为GitHub( http://www.github.com/greenspb/poker )上的存储库提供,但我想将其贡献给Composite R Archive Network。 I wrote the code years ago, but never shared it out of fear. 我几年前编写了代码,但出于恐惧从未共享。 This is my first repository on GitHub and my first submission to CRAN. 这是我在GitHub上的第一个存储库,也是我第一次提交CRAN。 I have researched how to get my package on CRAN by reading a blog post at http://kbroman.org/pkg_primer/pages/cran.html . 我通过阅读位于http://kbroman.org/pkg_primer/pages/cran.html的博客文章,研究了如何在CRAN上获取软件包。 I am stuck on step 1: 我陷入了第一步:

"Run R CMD check --as-cran and eliminate all problems. If there are any errors or warnings, your package will not be accepted at CRAN. And even a “Note” will likely disqualify you. So figure out what all of those errors, warnings, and notes mean and then revise your package so that they are no longer issued." “按原样运行R CMD检查-并消除所有问题。如果有任何错误或警告,您的包裹将不会在CRAN被接受。甚至“注释”也可能会取消您的资格。因此,请找出所有这些原因错误,警告和注释的意思,然后修改您的软件包,以使其不再发出。”

The report generated by "Run R CMD check --as-cran poker" for my "poker" package ( available as a repository on GitHub ) contains errors. 我的“扑克”包(在GitHub上可作为存储库)的“运行R CMD检查--as-cran扑克”生成的报告包含错误。 My concern is failure to make the LaTeX manual. 我担心的是未能制作LaTeX手册。

Resolved Issues 解决的问题

I used roxygen2 comment tags in the .R file in the project's R folder. 我在项目的R文件夹中的.R文件中使用了roxygen2注释标签。 roxygen2::document() successfully translated \\cr in a comment tag into a new line in the LaTeX file, however it unsuccessfully translated every empty \\tab in a comment tag into {} [empty curly parentheses] in the LaTeX file. roxygen2::document()成功将注释标签中的\\ cr转换为LaTeX文件中的新行,但是未成功将注释标签中的每个空\\ tab转换为LaTeX文件中的{} [空的大括号]。 This happened in dozens and dozens of instances. 这发生了数十个实例。 The \\tabular environment was used in an attempt to preserve formatting. \\tabular环境用于尝试保留格式。 I was able to clean up LaTeX errors whenever "There was no line here to end" by searching for {} and replacing appropriate instances with \\\\{} . 只要搜索{}并用\\\\{}替换适当的实例,我就可以清理LaTeX错误。

Unresolved Issues 尚未解决的问题

I have no idea how to solve the LaTeX error "Rd2.tex: File Ended while scanning definition of \\LT@xxiii ", although I believe \\LT stands for long table. 我不知道如何解决LaTeX错误“ Rd2.tex:扫描\\LT@xxiii定义时文件结束”,尽管我相信\\LT代表长表。 I am only able to make pdf manuals of several individual functions using R CMD Rd2pdf on the .rd documentation files. 我只能使用.rd文档文件上的R CMD Rd2pdf制作一些单独功能的pdf手册。

My code is documented using roxygenize tags. 我的代码是使用roxygenize标签记录的。 When I execute the Run R CMD check --as-cran command, R encounters errors and warnings and fails to make the pdf for the entire package. 当我执行Run R CMD check --as-cran命令时,R遇到错误和警告,并且无法制作整个软件包的pdf。 I need assistance to fix the errors in the report. 我需要协助来纠正报告中的错误。 I want to get my package on CRAN. 我想在CRAN上获得我的包裹。

See Also 也可以看看

Question on r-package-devel@r-project.org mailing list. 有关r-package-devel@r-project.org邮件列表的问题。

Removing comments on the local variables was the answer to fixing the errors ( replying to @Dason). 删除对局部变量的注释是解决错误的答案(回复@Dason)。 Thank you. 谢谢。

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

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