Derek Corcoran
Derek Corcoran

Reputation: 4102

Checking my package "--as-cran" does not match the results of CRAN

The problem

I am trying to send my package to cran, I already have two R packages in cran DiversityOccupancy and SpatialBall, which is to say I have done this before. I am using linux 16.04 as my OS. When I check the NetworkExtinction package in R using devtools with the "--as-cran" options I get 0 notes, 0 warnings and 0 Errors, when I send the source to cran however I get the following result:

* using log directory 'd:/RCompile/CRANincoming/R-devel/NetworkExtinction.Rcheck'
* using R Under development (unstable) (2018-03-09 r74376)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'NetworkExtinction/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'NetworkExtinction' version '0.1.0'
* package encoding: UTF-8
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Derek Corcoran <[email protected]>'

New submission
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK  
* checking for portable file names ... OK
* checking serialization versions ... OK
* checking whether package 'NetworkExtinction' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* loading checks for arch 'i386'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
** checking loading without being on the library search path ... OK
** checking use of S3 registration ... OK
* loading checks for arch 'x64'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
** checking loading without being on the library search path ... OK
** checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK  
* checking R code for possible problems ... [7s] OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking installed files from 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... [7s] OK
** running examples for arch 'x64' ... [9s] OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking re-building of vignette outputs ... [12s] OK
* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! Package inputenc Error: Unicode char †(U+2010)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
* checking PDF version of manual without hyperrefs or index ... ERROR
* DONE
Status: 1 ERROR, 1 WARNING, 1 NOTE

I understand where the problem is, but I have sent it three times to cran after fixing those "problems" I would like to be able to replicate said problems from my computer, but even when I check "as--cran" I do not get the same warnings and errors, how can I fix those errors if I cannot replicate them? I do not want to keep sending it to cran to see if I fixed the problems, I know I am missusing their time.

Upvotes: 2

Views: 535

Answers (1)

llrs
llrs

Reputation: 3397

I found this problem in one of my packages, on Linux it was correctly converted but on Windows there were some errors. The source of the problem was using an unicode character on the documentation that could not be automatically converted.

I think this is related to what I read on the about_encoding of the stringi manual.

R lets strings in ASCII, UTF-8, and your platform’s native encoding coexist. A character vector printed on the console by calling print or cat is silently re-encoded to the native encoding

This doesn't seem to be consistently applied across OS or on Windows.

Anyway, in order to solve the issue I had to replace the offending character by the equivalent \u+code: In this case the U+2010 character is the hyphen "‐". You probably have it on the documentation (Rd files, roxygen2 comments or vignettes(?)).

Error: #' My roxygen comment with "strange" symbol - ∩

Right:#' My documentation without error and strange symbol \\u2010 \\u2229

I had to escape the , otherwise it was marked as unrecognized macro. See also this question about several ways to deal with this problem.


You can also check for this on Linux running R CMD Rd2pdf --no-clean myPackage Then explore the .Rd2XXX folder, on one of the Rd2.* documents there.

Upvotes: 1

Related Questions