6 Objects
Common objects in R include:
- vectors,
- matrices,
- lists,
- data frames (Data frames are like matrices, but instead of numbers, the entries can be numbers or other types of variables, e.g., factors, dates, etc).
Entries in the objects can be categorized into certain data types.
- numeric (double precision real numbers),
- integer (specified by an
Lsuffix), - complex,
- logical,
- character (non-numeric data, for example, the address of a patient),
- factors (categorical variables).
A vector can only contain data of the same class, but a list can contain data of different classes.
We could use class() and str() to check the object/data type.


Some people prefer to use the attributes() function.