My question is almost opposite to this one. I document my package with roxygen2, and within it define an S3 generic:
#' @export
print.myClass <- function(x, ...) { cat("Hello there!\n") }
The method gets correctly dispatched, however, it is not visible for the user – despite using @export
, the user cannot access this method directly. roxygen2 only enters S3method(print,myClass)
in the NAMESPACE file, but does not export it.
However, some S3 generics are visible (e.g. print.table or print.data.frame). I would like my method to be also attached to the user namespace. Is there an easy way of doing that in roxygen2? I.e., forcing roxygen2 to add export(print.myClass)
to the NAMESPACE file?