is.language {base}R Documentation

Is an Object a Language Object?

Description

is.language returns TRUE if x is either a variable name, a call, or an expression.

Usage

is.language(x)

Arguments

x object to be tested.

Details

is.language is generic: you can write methods to handle specific classes of objects, see InternalMethods.

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

Examples

ll <- list(a = expression(x^2 - 2*x + 1), b = as.name("Jim"),
           c = as.expression(exp(1)), d = call("sin", pi))
sapply(ll, typeof)
sapply(ll, mode)
stopifnot(sapply(ll, is.language))

[Package base version 2.2.1 Index]