Is an Object 'internally classed'? (original) (raw)

is.object {base} R Documentation

Description

A function mostly for internal use. It returns TRUE if the object x has the R internal OBJECT bit set, andFALSE otherwise. The OBJECT bit is set when a"class" attribute is added and removed when that attribute is removed, so this is a very efficient way to check if an object has a class attribute. (S4 objects always should.)

Note that typical basic (‘atomic’, see [is.atomic](../../base/help/is.atomic.html))R vectors and arrays x are not objects in the above sense as [attributes](../../base/help/attributes.html)(x) does not contain "class".

Usage

is.object(x)

Arguments

Note

This is a primitive function.

See Also

[class](../../base/help/class.html), and [methods](../../utils/html/methods.html).

[isS4](../../base/help/isS4.html).

Examples

is.object(1) # FALSE
is.object(as.factor(1:3)) # TRUE

[Package _base_ version 4.6.0 Index]