I was working on a R programming tutorial and noticed a slight anomaly:
x <- c(2,1,1,5) creates a vector of type numy <- c(1:5) creates an int type vectorz <- c(1.5,2.3) creates a vector of type num
Why is this happening? What is the main data type in R : is it int or is it num ? What happens if one of the elements of a vector is a float , will the vector type become float or is it something else? What happens when all the elements in a float vector - why is it still num in this case?
source share