CRAN 发现警告 R CMD check --as-cran does not

CRAN finds an warning that R CMD check --as-cran does not

我在 Windows 7.

上使用 32 位 R 3.1.2

我最近对一个最近开发的软件包进行了 R CMD check --as-cran,但只收到 'New submission' 注释。此处和 R-devel 上的研究表明可以忽略这一点。我还使用了 devtools::build_win() 并且没有收到任何注释或警告,除了前面提到的那个。此外,我使用 R CMD buildR CMD INSTALL --build 在本地构建了包,一切正常,包括 PDF 手册。

提交给 CRAN 后,我被告知抛出警告:

    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}}

这里的其他研究表明我使用 win-builder.r-project.org/ 检查我的开发版本的包,该测试的结果只抛出 "New submission" 警告。

我很茫然。我无法复制 CRAN 发现的错误,并且一切似乎在我的机器和 win-builder.r-project.org 上都正常工作。

有人可以帮我解决这个问题吗?我承认我不是 LaTeX 专家,但考虑到这条线不是 windows 上的 R 3.1.2 或 win-build 上的开发版本的问题,我不知道从哪里开始。

包装信息可在此处获得:

creelSurvey

我使用 inlinedocs 包来编写我的函数和注释。警告来自 .R,第 127 行:

this function

和 .Rd 第 39 行:

this .Rd

感谢您的帮助。

通过克隆 Github 存储库和 运行

,我能够使用 r-devel 在 Ubuntu 12.04 上重现此问题
R CMD build creelSurvey
R CMD check --as-cran BusRouteCreelSurvey_0.2.1.tar.gz

我能够通过从 man/SimulateBusRoute.Rd 中删除 DOS 行尾标记(^MCtrl-M)来修复它。我不知道在 Windows 上执行此操作的最简单方法(您可以寻找 dos2unix 实用程序,或者可能想出 readLines 解决方案。

我不知道它如何跨平台工作,但这似乎对我有用:

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

我会 (1) 在 R Extensions manual 中寻找(可能晦涩难懂的)关于行尾标记的警告,然后 (2) 向 CRAN 维护者或通过在 r-devel@r-project.org.

一般来说,如果您可以在 Linux 系统上设置测试版本,您应该能够检测到这些问题;我不知道 Linux 系统的 win-builder.r-project.org 等效项,但 http://travis-ci.org is a good resource, and this Github project 是开始在 Travis 上进行 R 项目的好方法。 (或者您可以在 R-forge 上设置您的项目。)我认识到这可能比您现在正在寻找的项目更重要,只是包括它以供将来参考。