简体   繁体   中英

Roxygen2 - “argument is of length zero” error when documenting reference class

To demonstrate a minimal case, say I have the following package:

#' @docType package
#' @import methods
#' @title MyTitle
#' @description MyDescription
#' @details MyDetails
#' @export
A <- setRefClass("A")

When I roxygenize (in RStudio , before a ' Build & Reload '). I get:

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

* checking for changes ... ERROR

Error in process.docType(partitum) : 
  Roclet processing error in block Test1.R:7
argument is of length zero

What's going wrong? How do I resolve this error?

My setup:

  • Roxygen2 3.1.0
    • Using roxygen to generate (in RStudio):
      • Rd files
      • Collate field
      • NAMESPACE file
    • Automatically roxygenising when running (in RStudio):
      • R CMD check
      • Source and binary package builds
      • Build & Reload
  • R: 3.0.2 (Frisbee Sailing)
  • IDE: RStudio 0.98.490
  • OS: Windows 8.1

I had a similar situation where

#' @export
A <- setRefClass("A")

cause the same error, which I resolved using:

A <- setRefClass("A")
#' @export
A 

Curiously, this was in a file that I had not modified in a while, so it's still a bit of a mystery...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM