data.class
Class of an Object

Description

Determines the class for arbitrary data.

Usage

data.class(x)

Arguments

x an object.
Value
returns a character string giving the class attribute of x, or inferring a class attribute from the other attributes of x. These inferred attributes include "matrix", "array", and the atomic modes.
See Also
class
Examples
data.class(colnames(Sdatasets::air))  #  "character"
data.class(Sdatasets::air[, 1]) # "numeric"
data.class(Sdatasets::air) # "data.frame"

data.class(1:12) # "numeric" data.class(matrix(1:12, nrow = 3)) # "matrix" data.class(factor(1:6)) # "factor" data.class(TRUE) # "logical" data.class(list(a = 1:5, b = c("aa", "bb"))) # "list"

Package base version 6.1.1-7
Package Index