Data Types in R
In R programming, there are five basic data types. Also, everything in R is an object, so we will refer to these data types as classes of objects. So, these five types of objects are:
- Numeric
- Integer
- Complex
- Logical
- Character
Let's briefly look at each of these.
Numeric
In R, decimal values such as 8.5 are numeric. You can assign a numeric value to a variable and then that variable will be of numeric data type.
For any variable or object, you can check it's data type by using the class command.
1> # Assign a decimal value to x
2>
3> x Test Your Knowledge
Check your understanding of this lesson with a short quiz.
