- Hands-On Geospatial Analysis with R and QGIS
- Shammunul Islam
- 104字
- 2021-06-10 18:44:22
Basic data types in R
There are three main data types in R, and they are as follows:
- Numerics
- Logical or Boolean
- Character
Numerics are any numbers with decimal values; thus, 21.0 and 21.1 are both numerics. We can use addition, subtraction, multiplication, division, and so on, with these numerics. Interestingly, R also considers integer numbers to be numerics. Logical or Boolean data consists of TRUE and FALSE; they are mainly used for different comparisons. The character variable consists of text, such as the name of something. We write character values in R by putting our character values inside "", or double quotes.