A class is just an attribute of an object. You can remove the attribute with the function unclass. The class with then become the type
A list can have different class.
unclass returns (a copy of) its argument with its class attribute removed. (It is not allowed for objects which cannot be copied, namely environments and external pointers.)
Example: A data frame will return a list:
class(USArrests)
[1] "data.frame"
If you unclass it, you will get a list
class(unclass(USArrests))
[1] "list"
Objects can change of class (coercion) using the as.* functions (if available).
The following hierarchy (order of precedence) occurs when creating an object with several classes:
? And:
See R - List
class(mean)
[1] "function"
> class(plot)
[1] "function"