Unlike Java or C#, R enables total flexibility in the assignment of variables. This means that you can assign objects of different types to the same variable. This will cause overriding:
var1 <- 10 var1 <- "a string"
In this case, for instance, R will not throw an error for var1
. In addition, there is no need to pre-declare the class of the variable.
The assignment of variables in R can be done in the following three ways:
For conventional variable assignments, there is no need to use this function. However, it becomes particularly useful...