If I am making a package, let's call it "P," that imports methods from packages "Q" and "R," is there an effective way to manage the methods accessible to users when the package is built?
That is, say package "Q" is actually the 'shiny' package. The package, in and of itself, is an interface, and so it obviously uses a LOT of shiny methods. Likewise, "R" is ggplot2 and the package makes use of a number of methods from it.
When I build the package, a user could import the package and select 'ggplot' under the namespace of "P." I don't want this to happen, as the user now has access to ~40-50 methods of which I don't want access given. I would rather the user only be able to import the package and use the methods developed in the new package, NOT the methods from ggplot2 or shiny.
How can I import the methods of shiny and ggplot2 in development of my package... but NOT have these methods public to users? I have seen, in researching this problem, require([package])
as a possible line in Roxygen code snippets, but am unsure of how to include such, as @require
doesn't exist.
Edit: Including the DESCRIPTION imports and NAMESPACE file for relevant background information.
Imports:
config (>= 0.3.1),
deSolve (>= 1.31),
ggplot2 (>= 3.3.5),
ggpubr (>= 0.4.0),
golem (>= 0.3.2),
shiny (>= 1.6.0),
utils (>= 4.0.5)
import(shiny)
importFrom(deSolve,ode)
importFrom(ggplot2,aes)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggsave)
importFrom(ggplot2,labs)
importFrom(ggpubr,theme_pubr)
importFrom(golem,with_golem_options)
importFrom(shiny,NS)
importFrom(shiny,shinyApp)
importFrom(shiny,tagList)
importFrom(utils,write.csv)
importFrom(utils,zip)