1

roxygenize 在以下代码上失败,并显示以下错误消息。关于这个主题的其他帖子表明有一个错位的字符。我找不到任何问题!你能发现问题吗?

#' My Title. My Description
#'
#' @return A n x n \code{\link{matrix}} where n = the number of variables.  Row and column names are in the same order and are equivalent to the variable names in \samp{timeSeriesData}.  Each entry [i,j] in the matrix is the covariance between variable i and variable j.
#' @callGraphPrimitives
#' @note some notes here
MyFunc = function( timeseriesData ,  method , decayFactor  )
{
}


Error in do.call(paste, c(trimmed.lines, sep = "\n")) :
  variable names are limited to 256 bytes
Calls: roxygenize ... parse.ref.list -> append -> parse.ref -> parse.ref.preref
-> do.call
Execution halted

Edit1
如果我从长 @return 行中取出几个词,上面的代码就可以正常工作

Edit2
在 roxygenize 调用之前添加 sessionInfo() 结果。

R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  utils     datasets  grDevices methods   base

other attached packages:
[1] roxygen_0.1-2 digest_0.4.2
4

2 回答 2

6

这是一个已知的错误:请参阅这个涉及 roxygen 贡献者 Hadley Wickham 的讨论。

解决方法是使用较短的行:您的#' @return A n x n ...行中有大约 270 个字符(包括三个句子),因此可以轻松拆分。

于 2011-04-25T22:41:36.850 回答
2

另一种可能的解决方案是升级到 R2.13.0,现在您的字符长度的最大值为 10.000 而不是 256

于 2011-04-26T07:29:56.147 回答