首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >检查我的包"--as- CRAN“与CRAN的结果不匹配

检查我的包"--as- CRAN“与CRAN的结果不匹配
EN

Stack Overflow用户
提问于 2018-03-13 21:36:16
回答 1查看 411关注 0票数 2

问题所在

我正在尝试将我的包发送到cran,我已经在cran DiversityOccupancy和SpatialBall中有两个R包,也就是说我以前已经这样做过。我使用linux 16.04作为我的操作系统。当我使用带有"--as- cran“选项的开发工具检查R中的NetworkExtinction包时,我得到了0个注释,0个警告和0个错误,当我将源代码发送到cran时,我得到了以下结果:

代码语言:javascript
复制
* 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

我知道问题在哪里,但在修复这些“问题”后,我已经向cran发送了三次,我希望能够从我的计算机复制上述问题,但即使当我检查"as--cran“时,我也没有得到相同的警告和错误,如果我不能复制它们,我如何修复这些错误?我不想一直把它发给cran,看看我是否解决了问题,我知道我在浪费他们的时间。

EN

回答 1

Stack Overflow用户

发布于 2020-09-21 17:46:56

我在我的一个软件包中发现了这个问题,在Linux上它被正确转换了,但在Windows上有一些错误。问题的根源是在文档中使用了无法自动转换的unicode字符。

我认为这与我在stringi manualabout_encoding上读到的内容有关。

UTF允许ASCII、

-8和您的平台的本机编码的字符串共存。通过调用printcat在控制台上打印的字符矢量将以静默方式重新编码为本机编码

这似乎并不能在所有操作系统或Windows上得到一致的应用。

无论如何,为了解决这个问题,我不得不用等价的\u+code替换有问题的字符:在本例中是U+2010字符is连字符“-”。您可能在文档(Rd文件、roxygen2注释或短片(?))中找到了它。

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

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

我必须转义,否则它会被标记为无法识别的宏。另请参阅this question,了解处理此问题的几种方法。

您还可以在运行R CMD Rd2pdf --no-clean myPackage的Linux上检查这一点,然后浏览.Rd2XXX文件夹,该文件夹位于Rd2.*文档之一。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49257607

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档