roxygen2
How to export S3 method so it is available in namespace?
If you would like to have both an S3method and export directive in your NAMESPACE in an automated way with roxygen2, you can simply add an extra @export tag that is more explicit. To illustrate, I created a dummy package, exportTest. This package has only one file in the R/ subdirectory, print.foo.R: #’ Print method … Read more
Exporting non-S3-methods with dots in the name using roxygen2 v4
As Mr Flick commented, appending the full function name to the roxygen line works correctly. If I change the line to: #’ @export check.arg then the NAMESPACE file contains: export(check.arg)
Importing two functions with same name using roxygen2
The thing to keep in mind is that you cannot have more than one function with the same name in your package’s namespace. Suppose there are two packages, pkgA and pkgB, that both export a function called foo. If you create a package, pkgC, that has import(pkgA) and import(pkgB) in the NAMESPACE. Now, when you … Read more
Roxygen2 – how to properly document S3 methods
As of roxygen2 >3.0.0, you only need @export: #’ A description of MyHappyFunction #’ #’ A details of MyHappyFunction #’ #’ @title MyHappyFunction: The my happy function #’ @param x numeric number #’ @param … other arguments #’ @examples #’ a <- 1 #’ class(a) <- “lm” #’ MyHappyFunction(a) #’ @export MyHappyFunction <- function(x, …){ … Read more