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 に答える