Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List exported objects from R package without attaching it

Tags:

r

cran

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

ls(loadNamespace("ggplot2"))

However this shows all of the defined and imported objects in this package. Instead I would like to see only the exported names. I.e. I would like the result of

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

But without actually attaching the package to my search path.

like image 452
Jeroen Ooms Avatar asked Mar 11 '12 20:03

Jeroen Ooms


1 Answers

You could use documented getNamespaceExports("ggplot2").

like image 150
Marek Avatar answered Oct 10 '22 05:10

Marek