I need to load and detach a lot of packages in one R session (I'm looking at which functions are methods across different packages). detach()
doesn't work for what I want, because it doesn't remove everything from the environment; for example, if you run:
require(pomp)
detach('package:pomp', character.only = TRUE)
print(methods('show'))
the show,pomp.fun-method
is still listed, which is not a method that exists in base R. How do I remove all methods and objects associated with a package? Alternately, is there a way to create a temporary environment in R to load the package, which I can then destroy to remove all objects in methods in a package?