【发布时间】:2014-05-01 09:29:02
【问题描述】:
当我构建我的包时,我收到了这个错误。您能帮我了解避免此错误的步骤吗?
#' Square a number
#'
#' Takes in any numeric value and squares it
#' @param x A value to be squared
#' @return The square of the input
#' @export
#' @example
square <- function(x)
{
return(x^2)
}
这是我按下构建时的错误:
==> roxygenize('.', roclets=c('rd', 'collate', 'namespace'))
* checking for changes ... ERROR
Error : example requires a value
【问题讨论】:
-
您没有在
@examples部分提供任何示例。尝试添加例如#' square(2)在该行下方。或者,完全删除@examples关键字。 -
我想我应该有那一行来完成我的任务。我正在使用更简单的功能自己学习 roxygen2,但我被卡住了。我应该说写示例(正方形)并得到结果。
-
然后应用第一个建议。
-
@gagolews 在旁注中,我按照你说的做了,收到了一个错误
==> roxygenize('.', roclets=c('rd', 'collate', 'namespace')) * checking for changes ... ERROR Error in file(con, "r") : Roclet processing error in block power.r:9 cannot open the connectionfor#' @example #' square(2) square <- function(x) -
那么
@examples呢?
标签: r package devtools roxygen2 roxygen