我正在尝试将我的软件包发送给我,我已经在cranOccupancy和SpatialBall中有两个R软件包,也就是说我以前做过这个。我使用linux 16.04作为我的操作系统。当我使用带有“--as-cran”选项的devtools检查R中的NetworkExtinction包时,我得到0个注释,0个警告和0个错误,当我将源发送到cran时,我得到以下结果:
* 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 <derek.corcoran.barrios@gmail.com>'
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
我明白问题出在哪里,但在修复了那些“问题”之后我已经发送了三次以便我能够从我的计算机上复制出这些问题,但即使我检查“as - cran”我没有得到相同的警告和错误,如果我无法复制它们,如何修复这些错误?我不想继续发送它,看看我是否解决了问题,我知道我错过了他们的时间。
答案 0 :(得分:1)
我在一个软件包中发现了此问题,在Linux上它已正确转换,但在Windows上却出现了一些错误。问题的根源是在文档上使用了无法自动转换的Unicode字符。
我认为这与我在stringi manual的about_encoding
上阅读的内容有关。
R允许使用ASCII,UTF-8和您平台的本机编码的字符串共存。通过调用
cat
在控制台上打印的字符向量被无提示地重新编码为本地编码
这似乎在整个OS或Windows上均未得到统一应用。
无论如何,为了解决该问题,我不得不用等效的\ u + code替换有问题的字符:在这种情况下,U + 2010字符is连字符“-”。您可能会在文档中找到它(Rd文件,roxygen2注释或vignettes(?))。
错误:#' My roxygen comment with "strange" symbol - ∩
右:#' My documentation without error and strange symbol \\u2010 \\u2229
我必须转义,否则将其标记为无法识别的宏。另请参阅this question,以了解解决此问题的几种方法。
您还可以在运行R CMD Rd2pdf --no-clean myPackage
的Linux上进行检查
然后在其中的一个Rd2。*文档中浏览.Rd2XXX文件夹。