Zack Parisa
Zack Parisa

Reputation: 51

R roxygen2 Error in preref.parsers[[tag]] %||% parse.unknown: attempt to use zero-length variable name

I intend to use roxygen2 roxygenize() to update my package documentation after a bit of work. I have done this successfully in the past. On this instance I encountered the following error message:

==> roxygenize('.', roclets=c('rd', 'collate', 'namespace'))

* checking for changes ... ERROR

Error in preref.parsers[[tag]] %||% parse.unknown : 
  attempt to use zero-length variable name

I don't doubt that I have a problem with a variable name somewhere, though I don't know how to locate the source of the error.

R CMD check doesn't identify any problems other than the collate and namespace issues which are what I mean to use roxygen2 to rectify...

Any help would be appreciated.

Upvotes: 2

Views: 409

Answers (1)

Zack Parisa
Zack Parisa

Reputation: 51

To track the problem down I systematically removed files and re-ran roxygenize() until it no longer failed to run through.

Having identified the offending file, as suggested, it was a misplaced "@".

This results in the aforementioned error:

#' @ export

So simply fix the misplaced space and problem solved:

#' @export

The difficult aspect is locating the typo.

Upvotes: 3

Related Questions