我收到来自 roxygenize()
的错误消息我无法理解。我有一个杂项功能包,其中 .Rd 文件是通过 roxygen 生成的。
错误是 Error: titlerequires a value
,这表明没有 @title
标签。但是有一个 @title
kmmisc-package.R
中的标签文件,所以我不确定问题是什么。kmmisc-package.R
包含:
##' Miscellaneous Functions
##'
##' \tabular{ll}{
##' Package: \tab kmmisc\cr
##' Type: \tab Package\cr
##' Version: \tab 0.1-2\cr
##' Date: \tab 2011-10-06\cr
##' License: \tab GPL-2\cr
##' LazyLoad: \tab yes\cr
##' LazyData: \tab yes\cr
##' }
##'
##' @author Me \email{my@@email}
##'
##' Maintainer: Me \email{my@@email}
##'
##' @name kmmisc-package
##' @docType package
##' @title KM Misc
##' @keywords package
##'
NULL
我正在使用 R 2.13.2 和刚刚从 CRAN 重新安装的 roxygen2 2.1。完整版
sessionInfo()
是在 https://gist.github.com/1268056 的要点编辑
在@andrie 的建议下,我现在有了
#' Miscellaneous Functions
#'
#' \tabular{ll}{
#' Package: \tab kmmisc\cr
#' Type: \tab Package\cr
#' Version: \tab 0.1-2\cr
#' Date: \tab 2011-09-14\cr
#' License: \tab GPL-2\cr
#' LazyLoad: \tab yes\cr
#' LazyData: \tab yes\cr
#' }
#'
#' @author Me \email{my@@email}
#'
#' Maintainer: Me \email{my@@email}
#' @name package-kmmisc
#' @docType package
#' @title KM Misc
#' @keywords package
#' @aliases kmmisc package-kmmisc
#'
#'
NULL
这仍然产生相同的错误。
最佳答案
我无法从您的第一个代码中复制错误...
您是否收到来自 roxygenize()
的相同错误消息?到下面的简单例子?
#' A test function
#'
#' Description
#'
#' Details
#'
#' @param x numeric number
f1 <- function(x) {
x
}
附加信息:
@Andrie 的代码,
#' @aliases kmmisc package-kmmisc
, 有一个 @aliases problem .在 roxygen2 2.1 中,
#' @aliases a-b
,它有一个连字符,生成 Rd 引用标签 \alias{"a-b"}
.在这种情况下代码没有问题,但在其他情况下需要一些注意。
当然,如果需要引用标签,就加
#' @aliases a-b
.所以我认为最好更换
#' @aliases kmmisc package-kmmisc
与 #' @aliases kmmisc
在这种情况下:#' Miscellaneous Functions
#'
#' \tabular{ll}{
#' Package: \tab kmmisc\cr
#' Type: \tab Package\cr
#' Version: \tab 0.1-2\cr
#' Date: \tab 2011-09-14\cr
#' License: \tab GPL-2\cr
#' LazyLoad: \tab yes\cr
#' LazyData: \tab yes\cr
#' }
#'
#' @author Me \email{my@@email}
#'
#' Maintainer: Me \email{my@@email}
#' @name package-kmmisc
#' @aliases kmmisc
#' @docType package
#' @title KM Misc
#' @keywords package
NULL
关于roxygen2 "Error: titlerequires a value",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7678284/