is.atomic(x) is.language(x) is.recursive(x)
x | any object. |
is.atomic | returns TRUE if the mode of x is numeric, logical, character, complex, raw, or null. For example, an object of mode list is not atomic, while a matrix of mode numeric is atomic. |
is.language | returns TRUE if x is an object that is part of the language (that is, the value of a call to parse or an object that has one of the special modes used by the engine's parser such as call, if, or expression). |
is.recursive | returns TRUE if the mode of x indicates that x is a recursive object; that is, it is an object that can contain other objects as elements: most commonly list, but also expression, graphics, and a number of modes used in manipulating the language. However, is.recursive returns FALSE for objects with slots. (Use length(getSlots(x)) to determine if an object has slots.) |
x <- matrix(1:12, 4) is.atomic(x) # returns TRUE is.language(x) # returns FALSE is.recursive(x) # returns FALSEx <- list(a=1, b=list(c=2, d=3)) is.atomic(x) # returns FALSE is.language(x) # returns FALSE is.recursive(x) # returns TRUE
x <- as.name("foo") is.atomic(x) # returns FALSE is.language(x) # returns TRUE is.recursive(x) # returns FALSE
x <- expression(1+x) is.atomic(x) # returns FALSE is.language(x) # returns TRUE is.recursive(x) # returns TRUE
x <- call('print', 1:3) is.atomic(x) # returns FALSE is.language(x) # returns TRUE is.recursive(x) # returns TRUE
is.atomic(NULL) # returns TRUE