is.function {base} | R Documentation |
Checks whether its argument is a (primitive) function.
is.function(x) is.primitive(x)
x |
an R object. |
is.function
is generic: you can write methods to handle
specific classes of objects, see InternalMethods.
is.primitive(x)
tests if x
is a primitive function
(either a "builtin"
or "special"
as from typeof
)?
TRUE
if x
is a (primitive) function, and FALSE
otherwise.
is.function(1) # FALSE is.function(is.primitive) # TRUE: it is a function, but .. is.primitive(is.primitive) # FALSE:it's not a primitive one, whereas is.primitive(is.function) # TRUE: that one *is*