简体   繁体   中英

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. I have created an R package on my computer that I would like to distribute. 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. 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. I have researched how to get my package on CRAN by reading a blog post at http://kbroman.org/pkg_primer/pages/cran.html . 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."

The report generated by "Run R CMD check --as-cran poker" for my "poker" package ( available as a repository on GitHub ) contains errors. My concern is failure to make the LaTeX manual.

Resolved Issues

I used roxygen2 comment tags in the .R file in the project's R folder. 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. This happened in dozens and dozens of instances. The \\tabular environment was used in an attempt to preserve formatting. I was able to clean up LaTeX errors whenever "There was no line here to end" by searching for {} and replacing appropriate instances with \\\\{} .

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. I am only able to make pdf manuals of several individual functions using R CMD Rd2pdf on the .rd documentation files.

My code is documented using roxygenize tags. 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. I need assistance to fix the errors in the report. I want to get my package on CRAN.

See Also

Question on r-package-devel@r-project.org mailing list.

Removing comments on the local variables was the answer to fixing the errors ( replying to @Dason). Thank you.

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