I am working on the upgrade to ggtern to handle ggplot 2.0.X, I need to import the grid package, however, ggplot2 is now exporting arrow
and unit
functions, which generates warnings when my package is loaded:
Warning messages:
1: replacing previous import by ‘grid::arrow’ when loading ‘ggtern’
2: replacing previous import by ‘grid::unit’ when loading ‘ggtern’
Is it possible to import the library with the exception of a couple of functions, ie something to the effect of the following might be useful in roxygen:
#' @importAllExcept grid arrow unit
Which should have the same effect as the following, (minus importing arrow
and unit
):
#' @import grid
Any suggestions?
Currently my best idea is
all <- getNamespaceExports("grid")
paste("@importFrom grid", paste(all[!(all %in% c("arrow", "unit"))], collapse = " "))
#[1] "@importFrom grid grid.edit pop.viewport ...
That's obviously not a good solution, but unlike for exports you can't use a regex for imports, i.e., there is no importPatternFrom
.
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