Suraj
Suraj

Reputation: 36597

variable names are limited to 256 bytes

roxygenize is failing on the following code with the following error message. Other posts on this topic indicate that there's a misplaced character. I can't find anything wrong! Can you spot the issue?

#' 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
The above code works just fine if I take out a few words from the long @return line

Edit2
Adding sessionInfo() results before the roxygenize call.

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

Upvotes: 1

Views: 714

Answers (2)

Sir Ksilem
Sir Ksilem

Reputation: 1205

The other possible solution is upgrading to R2.13.0, now your character length has a max value of 10.000 instead of 256

Upvotes: 2

Henry
Henry

Reputation: 6784

This is a known bug: see this discussion involving Hadley Wickham, a contributor to roxygen.

The work-round is to have shorter lines: your #' @return A n x n ... line has about 270 characters (including three sentences) in it, so could easily be split.

Upvotes: 6

Related Questions