[Rd] Potential cross-platform package building issue

Duncan Murdoch murdoch.duncan at gmail.com
Sun Jan 4 01:44:54 CET 2015

On 03/01/2015 3:49 PM, Steven Ranney wrote:
> I am using 32-bit R 3.1.2 on Windows 7.
> I recently conducted an `R CMD check --as-cran` on a recently-developed
> package and received only the 'New submission' note. Research on
> StackOverflow and on R-devel suggested this could be ignored. I also used
> devtools::build_win() and received no notes or warnings, other than the one
> mentioned previously. Lastly, I conducted an `R CMD check` with the
> development version of R.  Further, I built the package locally with `R CMD
> build` and `R CMD INSTALL --build` and everything worked as it should,
> including the PDF manual.
> Upon submission to CRAN, I was told 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}}
> I asked for assistance in resolving this issue as I could not replicate the
> WARNING.  Another user could replicate the warning on Ubuntu 12.04 but was
> able to resolve the issue by removing the DOS end-of-line markers (^M or
> Ctrl-M) from the .Rd file.  Neither he nor I could find anything in the R
> Extensions Manual that discussed removing end-of-line markers.

I've looked more closely at the file:  it doesn't have either Unix or
DOS end-of-line markers, it has CR-CR-LF (or 0D 0D 0A in hex), and
that's what confused R.  Unix uses LF, DOS used CR-LF, but nobody uses
CR-CR-LF.  I've seen things like that caused by auto-conversion of
files, so maybe Github did this to you.  (The R sources all use LF, so
that's the safest choice, but CR-LF should work fine too.)

The likely reason that Linux systems detected the error while your
Windows systems didn't is because the LaTeX systems handle these line
endings differently.

So I think this has to be classed as user error.

Duncan Murdoch

> Link to the thread on StackOverflow.com:
> http://stackoverflow.com/questions/27756679/cran-finds-an-warning-that-r-cmd-check-as-cran-does-not
> Link to GitHub repository: http://www.github.com/stevenranney/creelSurvey
> Is this an obscure cross platform issue?  If so, I would have thought that
> someone else would have already discovered this.  If this is normal
> behavior, is there a simple way to remove these end of line markers so I
> can minimize WARNINGS from CRAN in the future?
> Thanks -
> Steven Ranney
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list