This question is related to but distinct from Exporting non-S3-methods with dots in the name using roxygen2 v4. From that post I learned that one needs to use @export function.name
in order for the NAMESPACE to be written correctly by roxygen. I have done that and the NAMESPACE is correctly written.
My problem comes when I do R CMD Check. I have legacy code that has a function tail.g()
. R CMD Check throws a NOTE noting that an apparent S3 method has been exported but not registered.
A reproducible example is below. Observe that xxxx.g
doesn't have the NOTE, which leads me to believe that because tail
is a generic in the utils package I need some special work-around. I'd prefer not to rename tail.g to tail_g because this is legacy code. I wish to eliminate all notes for a successful CRAN submission.
library(roxygen2)
package.skeleton("test")
writeLines(
"#' Check an argument
#'
#' Checks an argument.
#' @param ... Some arguments.
#' @return A value.
#' @export tail.g
tail.g <- function(...) 0",
"test/R/tail.g.R"
)
writeLines(
"#' Check an argument
#'
#' Checks an argument.
#' @param ... Some arguments.
#' @return A value.
#' @export xxxx.g
xxxx.g <- function(...) 0",
"test/R/xxxx.g.R"
)
roxygenise("test")
setwd("./test")
devtools::check(document=FALSE)
Gives the NOTE:
checking S3 generic/method consistency ... NOTE
Found the following apparent S3 methods exported but not registered:
tail.g
How do I eliminate the NOTE for tail.g() without renaming?