About
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.
Articles Related
Management
Unclass
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"
Change
Objects can change of class (coercion) using the as.* functions (if available).
Type
Atomic
Non Atomic
- expression
- ….
Hierarchy
The following hierarchy (order of precedence) occurs when creating an object with several classes:
- NULL
- raw
- numeric (double)
- expression
- function
? And:
- factor ?
Example
List
See R - List
Function
class(mean)
[1] "function"
> class(plot)
[1] "function"