Data Types in R
For understanding data types in any language, it often helps to find out the most elementary data type because often other data types are built on elementary ones. In our case, vectors are the most elementary so let’s define a vector first. Vectors - They are used to store ordinal data (data where order matters) of the same base type ie. you can store 1 and 3.4 in a vector because they have the same base type - numeric. There are other types like logical (TRUE, FALSE), and character ( “a” , “ b"). If that ’ s very confusing think about coordinates in a plane or space. The order of numbers used to specify coordinates matters( ie. (2,1) is different from (1,2) ) and hence we would use a vector to store things like that. Arrays(multi-dimensional) - Arrays are the most common data types in other languages but not in R. R stores arrays as vectors with two other parameters - number of dimensions and names f...