As mentioned in the comments, you only need to import it once, but importing it many times doesn't cause any problems.
If you don't want to import it in every function, but are worried about tying it to a single function (what if you only import it on function foo
, but later you decided to replace foo
with bar
and lose the import) you can add all your shared import statements to NULL
at the top of the document:
#' @import ggplot2
#' @import B
#' @import dplyr
NULL
roxygen2
will happily create the proper import statements in NAMESPACE
, but you'll only have the imports listed once in a convenient place without tying them to any particular package
@import [function to import]
once. Then it will be available throughout your package as long it is also in your DESCRIPTION file as an import. Often I think it is just easier to reference the package directly using::
– Sizeable