CRAN finds warning that R CMD check --as-cran is not

I am using 32-bit R 3.1.2 on Windows 7.

I recently ran the R CMD check --as-cran on a newly developed package and received only the “New View” note. Research here and on R-devel suggested that this could be ignored. I also used devtools::build_win() and did not receive any notes or warnings other than those indicated earlier. In addition, I built the package locally with R CMD build and R CMD INSTALL --build , and everything worked as it should, including the PDF manual.

After submitting to CRAN, they told me that a warning was thrown:

  This fails to make its manual: * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! Missing $ inserted. <inserted text> $ l.682 }{} ! Missing } inserted. <inserted text> } l.682 }{} ... The line appears to be \widehat{R_1} = \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}} 

Additional research shows that I am using win-builder.r-project.org/ to test my package against the development version, and the results of this test threw only a “New View” warning.

I'm at a loss. I cannot reproduce the error that CRAN found that everything was working correctly on my machine and on win-builder.r-project.org .

Can anyone help me solve this problem? I freely admit that I am not an LaTeX expert, but given that the line was not a problem with R 3.1.2 on windows or the development version on win-build, I do not know where to start.

Package information is available here:

creelSurvey

I used the inlinedocs package to write my functions and comments. The warning comes from line .R, line 127:

this function

and line .Rd 39:

this.Rd

Thank you for your help.

+6
source share
1 answer

I was able to reproduce this issue on Ubuntu 12.04 with r-devel by cloning the Github repository and doing

 R CMD build creelSurvey R CMD check --as-cran BusRouteCreelSurvey_0.2.1.tar.gz 

I was able to fix it by removing the end-of-line DOS markers ( ^M or Ctrl-M ) from man/SimulateBusRoute.Rd . I don't know the easiest way to do this on Windows (you can find the dos2unix utility or maybe come up with a readLines solution.

I don't know how this will work on different platforms, but this seems to work for me:

 fn <- "MakeAnglers.Rd" r <- readLines(fn) writeLines(r[nchar(r)>0],con="new.Rd") 

I would like to (1) look for (possibly obscure) warnings in the R Extensions manual about the end-of-line mark, and then (2) report this either to CRAN maintainers, or by posting them on r-devel@r-project.org .

In general, you should be able to detect these problems if you can set up a test build on a Linux system; I don't know the win-builder.r-project.org equivalent for Linux systems, but http://travis-ci.org is a good resource, and this Github project is a good way to get started with R projects on Travis. (Or you can set up your project on R-forge.) I understand that it may be a project rather than looking for it right now, just by including it for future reference.

+4
source

Source: https://habr.com/ru/post/980472/


All Articles