List of exported objects from package R without connecting it

Is there a way to list the objects that the package exports without actually adding it? I tried

ls(loadNamespace("ggplot2")) 

However, this shows all the defined and imported objects in this package. Instead, I would like to see only exported names. That is, I would like to get the result

 library(ggplot2) ls("package:ggplot2") 

But without binding the package to the search path.

+7
source share
2 answers

You can use the documented getNamespaceExports("ggplot2") .

+9
source

I found it. Undocumented

 ls(getNamespaceInfo(mynamespace, "exports")); 

This seems to be a trick.

+4
source

All Articles