Roxygen documentation of list items
I am learning Roxygen and making good progress so far. I've been able to document most of the package that I'm working on, but I've got a few places that I can't seem to get right. Please consider the following minimal R:
##' Test Roxygen Comments
##'
##' This is a test of the Roxygen System. Had this been actual
##' documentation, it may have contained information about the
##' directives and/or structures below.
##'
##' @name simple
##' @docType data
##' @rdname simple
variable <- list(
##' itema comments
itema <- c("bing", "bang", "bong"),
##' itemb comments
itemb <- "fooflakes"
)
##' More info abuot variable!
##' @rdname simple
The comments that are inside the list()
are just dropped by Roxygen I've confirmed this with:
> parse.file("package-test/R/simple.R")
$`1`
$`1`$description
[1] "Test Roxygen Comments\n\nThis is a test of the Roxygen System. Had this been actual\ndocumentation, it may have contai开发者_如何学Cned information about the\ndirectives and/or structures below.\n\n"
$`1`$name
[1] "simple\n"
$`1`$docType
[1] "data"
$`1`$rdname
[1] "simple"
$`1`$assignee
[1] "variable"
$`1`$srcref
$`1`$srcref$filename
[1] "package-test/R/simple.R"
$`1`$srcref$lloc
[1] 11 1 17 1 1 1
I have an options setting infrastructure, for which I'd like to use Roxygen to document the individual options. It doesn't seem to matter whether or not I indent the comments, moving them flush-left doesn't seem to help. Adding @rdname to every block doesn't seem to help either. Am I just expecting behavior that doesn't exist? In another question, the accepted answer said we could put Roxygen comments anywhere and that they would be collected.
So two fold: what am I missing above, and how do other people document individual data items if not like my attempt?
Thank you!
Roxygen does not do that. I need 5 more characters to be an official answer.
精彩评论