I'm receiving an error from roxygenize()
that I can't understand. I have a package of my miscellaneous functions in which the .Rd files are generated via roxygen.
The error is Error: titlerequires a value
, which suggests that there is no @title
tag. However there is an @title
tag in the kmmisc-package.R
file, so I'm not sure what the problem is.
kmmisc-package.R
contains:
##' 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
I'm using R 2.13.2 with roxygen2 2.1 just reinstalled from CRAN. The complete sessionInfo()
is in the gist at https://gist.github.com/1268056
At @andrie's suggestion, I now have
#' 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
which is still generating the same error.
I could not replicate the error form the your first code...
Are you receiving same error message from roxygenize()
to the following simple example?
#' A test function
#'
#' Description
#'
#' Details
#'
#' @param x numeric number
f1 <- function(x) {
x
}
An additional information:
The code by @Andrie, #' @aliases kmmisc package-kmmisc
, has a @aliases problem.
In roxygen2 2.1, #' @aliases a-b
, which has a hyphen, generates the Rd quoted tag \alias{"a-b"}
.
In this case the code has no problem, but in other case requires some attention.
Of course, if you need quoted tags, you add #' @aliases a-b
.
So I think that it's better to replace #' @aliases kmmisc package-kmmisc
with #' @aliases kmmisc
in this case:
#' 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
Try the following:
Uncomment your roxygen statements. (This might be a SO artefact, but each roxygen line should start with # '
, i.e. a single #
)
Make the following changes to the documentation
#' @name package-kmmisc #' @aliases kmmisc package-kmmisc
In other words:
@name
kmmisc
These are the only differences between your example and my own package documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With