This construct assigns the values โโof P variables with each of the other names indicated on the line <- s. This assignment will occur in the current environment.
Thus, if a variable with the name P in the rightmost value is not in the current environment, a new variable P will be created in the current environment.
To see this in action, run the following from a new R session:
ls() # character(0) mean <- a <- b <- mean ls() # [1] "a" "b" "mean"
Josh o'brien
source share