I read Advanced R by Hadley Wickham on his book's website. I found a question about replacement functions in R. The following result is given according to his book.
library(pryr)
x <- 1:10
address(x)
#> [1] "0x103945110"
x[2] <- 7L
address(x)
#> [1] "0x103945110"
He supposed that the address of x won't change if we just replace the second element of x. However, when I do this, the physical address of x actually changed. So, anybody tell me why?