[英]Package .Rd files using roxygen2 package
I have a question about creating an .Rd file for my R package using the roxygen2
package. 我有一个关于使用
roxygen2
包为我的R包创建.Rd文件的问题。
It is clear to me that, for documenting R functions, I can use Cc Co in emacs to generate comments above the function, and then fill them out, followed by roxygenize("pkg")
. 我很清楚,为了记录R函数,我可以在emacs中使用Cc Co来生成函数上方的注释,然后填充它们,然后是
roxygenize("pkg")
。 In this way, I have .Rd files for the R functions. 这样,我有R函数的.Rd文件。 However, I am not sure how can I get .Rd file for the data examples and the package itself?
但是,我不知道如何获得数据示例和包本身的.Rd文件? Currently, I am using
prompt("data")
to generate data.Rd and promptPackage("pkg")
to generate pkg-package.Rd . 目前,我使用
prompt("data")
生成data.Rd和promptPackage("pkg")
来生成pkg-package.Rd 。 I have to put these files into the man
folder, and then edit them separately. 我必须将这些文件放入
man
文件夹,然后单独编辑它们。 How can I document data and package in a similar way like documenting R functions using roxygen2
? 如何以类似的方式记录数据和包,比如使用
roxygen2
记录R函数?
Thank you very much! 非常感谢你!
For data, see this previous question on SO which suggests: 有关数据,请参阅上一个关于SO的问题,其中建议:
#' This is data to be included in my package
#'
#' @name data-name
#' @docType data
#' @author My Name \email{blahblah@@roxygen.org}
#' @references \url{data_blah.com}
#' @keywords data
NULL
I would suspect that you can do the same for pkg-package.Rd
. 我怀疑你可以为
pkg-package.Rd
做同样的事情。 If it must be in roxygen format, consider 如果它必须是roxygen格式,请考虑
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.