I am looking to import only a few functions from a package. Based on this issue, I can use @rawNamespace
to import except
.
However, what I would like to do is close to this answer. I would like to define a regular expression to only import certain functions automatically. I would like to avoid importing an entire package just for a couple of functions.
Example
#' My fancy function
#' @rawNamespace import(ggplot2, except = scale_fill_manual)
#' @export
hello_world <- function(){
print("Hello World!")
}
In the above example, I would like to do something like:
#' My fancy function
#' @rawNamespace import(ggplot2, include = scale_*)
#' @export
hello_world <- function(){
print("Hello World!")
}
The above example is super basic but I will actually use the imported functions somewhere else. I cannot simply use ::
accessors as I am programmatically getting the functions from the namespace.