Show names of everything in a package

r, r-package

Solution

`ls("package:foreach", all.names=TRUE)` only shows what's attached to the search path, which only includes the objects exported from the namespace. Use `ls` on the results of `getNamespace` instead:

ls(getNamespace("foreach"), all.names=TRUE)

Problem

Is there an easy way to list everything in a package from within R? For example, if I type `foreach:::` and hit tab twice, I can see everything that's there. How else can I get those names of objects? Note, `ls("package:foreach", all.names=TRUE)` does not show things like `.foreachGlobals`

Original source