Skip to content
Prev 173767 / 398503 Next

primitives again

G'day Edna,

On Sat, 14 Mar 2009 22:52:38 -0500
Edna Bell <edna.bell01 at gmail.com> wrote:

            
Well, I guess I can answer nevertheless. :)
?is.primitive

Thus, the following code would give you all the primitive functions in
package base:

R> pos <- "package:base"
R> uu <- ls(pos=pos, all=TRUE)
R> tt <- sapply(uu, function(x) is.primitive(get(x, pos=pos)))
R> rr <- uu[tt]
R> rr

You may want to search other packages too.  Or modify the code such
that you loop over your search path and concatenate the results from
the various locations.

HTH.

Cheers,

	Berwin