4

到目前为止,我正在学习 Roxygen 并取得了良好的进展。我已经能够记录我正在处理的大部分程序包,但我有一些地方似乎无法正确处理。请考虑以下最小 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

list()Roxygen 刚刚删除了里面的评论,我已经确认了这一点:

> 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 contained 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

我有一个选项设置基础设施,我想使用 Roxygen 来记录各个选项。我是否缩进评论似乎并不重要,将它们向左移动似乎没有帮助。将@rdname 添加到每个块似乎也无济于事。我只是期待不存在的行为吗?在另一个问题中,接受的答案是我们可以将 Roxygen 评论放在任何地方,并且它们会被收集。

所以有两个方面:我在上面遗漏了什么,如果不喜欢我的尝试,其他人如何记录单个数据项?

谢谢!

4

1 回答 1

4

Roxygen 不会那样做。我还需要 5 个字符才能成为正式答案。

于 2010-12-31T02:35:57.990 回答