'[<-' and '[[<-'

  • The “replacement versions” of these functions are '[<-' and '[[<-'
  • These are actually separate functions, that allow us to assign values at a specific index (see Chapter 9)
y[[c(1,2)]] <- 999
y
## $a
##  [1]   1 999   3   4   5   6   7   8   9  10
## 
## $b
##  [1] 11 12 13 14 15 16 17 18 19 20