【发布时间】:2017-11-27 02:02:03
【问题描述】:
我正在 RStudio 中对一个包运行 CMD 检查,其中一部分分析了内联 Roxygen 文档中的 @examples。
我收到此错误:
checking examples ... ERROR
Running examples in ‘packagename-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: checkDate
> ### Title: Ensure that a date string is a valid date
> ### Aliases: checkDate
>
> ### ** Examples
>
> checkDate("2017-05-06")
Error: could not find function "checkDate"
在我的 .R 文件中,文档定义为:
#' Ensure that a date string is a valid date
#'
#' @param dateString A string (eg. "2017-12-04").
#' @return TRUE or FALSE (and a warning if FALSE).
#' @examples
#' checkDate("2017-05-06")
#' checkDate("2017-05-40")
我正在使用 devtools 1.13.2 和 roxygen2 6.0.1,我认为这两个版本在发布时都是最新的。
我有其他包使用相同的 devtools/roxygen2 组合,但以前从未见过它无法在其范围内的 @examples 中找到函数名称。
其他人似乎经历过与this question 更新类似的事情,但我看不到有人说如何修复它。
【问题讨论】: