There are many types of data that can be assigned to variables in R. The most basic types are characters, numbers, and logicals. Characters, also known as strings, are a sequence of characters surrounded by quotes. Numbers are exactly what you'd expect. Numeric data types can be any type of number. Logical data types are Boolean
values of either true
or false
. The true
and false
values can include any of the iterations from the following code example:
c('T', 'True', 'TRUE', 'true') c('F','False','FALSE','false')
There are also a number of data classes, which are structures used to hold multiple values. These include vectors, matrices, data frames, factors, and lists. We'll examine each of these data types.