Determine the class of an arbitrary R object.
data.class(x)
| Parameter | Description |
|---|---|
x |
an R object. |
# NOT RUN {
x <- LETTERS
data.class(factor(x)) # has a class attribute
data.class(matrix(x, ncol = 13)) # has a dim attribute
data.class(list(x)) # the same as mode(x)
data.class(x) # the same as mode(x)
stopifnot(data.class(1:2) == "numeric") # compatibility "rule"
# }