csg*_*pie 10 documentation r roxygen2
例如,假设我的包中有一个函数闭包
f = function(x) {
x = x
g = function(y) x <<- y
h = function() x
list(g = g, h = h)
}
l = f(5)
l$g(10)
l$h()
Run Code Online (Sandbox Code Playgroud)
记录此功能的正确方法(在官方CRAN意义上)是什么?特别是,
roxygen2g和文档h一种方法是执行与?family您记录的位置g()和文件部分h()类似的操作。然后在定制中提供有关和的扩展文档,您可以在这两个函数的部分条目中指向该文档。Value.Rdg()h()\section{foo}Value
\value{
Returns an object of class \code{"foo"}, a list with the
following components:
\item{g}{function; does foo. See Returned Functions for details.}
\item{h}{function; does bar. See Returned Functions for details.}
}
\section{Returned Functions}{
The returned functions do, blah blah...
\code{g} is defined as
\preformatted{
g(x, y, z, ...)
}
Arguments are:
\describe{
\item{x}{foo}
\item{y}{foo}
\item{z}{foo}
}
}
Run Code Online (Sandbox Code Playgroud)
虽然 roxygen 无法从参数中执行此操作@param,但您应该能够将其编写为任意 roxygen 部分以添加到 Rd 文件中。该Value部分可以编写为标准 roxygen 标记,仅需要按字面输入定制部分。