Assignment may be one of the most fundamental expressions in all programming languages. What it does is assign or bind a value to a symbol so that we can refer to the value by that symbol later.
Despite the similarity, R adopts the <-
operator to perform assignment. This is a bit different from many other languages using =
although this is also allowed in R:
x <- 1 y <- c(1, 2, 3) z <- list(x, y)
We don't have to declare the symbol and its type before assigning a value to it. If a symbol does not exist in the environment, the assignment will create that symbol. If a symbol already exists, the assignment will not end up in conflict, but will rebind the new value to that symbol.