Is an Object of Type (Primitive) Function? (original) (raw)

is.function {base} R Documentation

Description

Checks whether its argument is a (primitive) function.

Usage

is.function(x)
is.primitive(x)

Arguments

Details

is.primitive(x) tests if x is a primitive function, i.e, if [typeof](../../base/help/typeof.html)(x) is either "builtin" or"special".

Value

TRUE if x is a (primitive) function, and FALSEotherwise.

Examples

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*

[Package _base_ version 4.6.0 Index]