My question is just to understand how one feature of the R language works. In "the R language definition" coming with any good release of R, there is something explaining how, for example, the setting of an element of a vector works with something that looks like an assignment but is not so straightforward:
x[3:5] <- 13:15
is a shortcut for:
`*tmp*` <- x
x <- "[<-"(`*tmp*`, 3:5, value=13:15)
rm(`*tmp*`)
What I don't understand is the reason why using an intermediate symbol *tmp* and not directly do the thing with the setter function.
x <- "[<-"(x, 3:5, value=13:15)
Until now I was suspecting that it has something to do with garbage collection but as this one has significantlly changed with the v4 and as the documentation did'nt change I am now supecting that I was wrong. Can somebody explain?
Thanks