Reputation: 1723
Using a character variable pkg_var
containing a package name: How can I get an internal object of that package?
I am looking for something like getPackage(x = pkg_var):::internal_object
mypackage:::internal_object
works of course, but is hard-coded.
Upvotes: 0
Views: 40
Reputation: 132706
Use getFromNamespace
:
getFromNamespace("cor.test.default", "stats")
#returns the function
Upvotes: 2