For example,

````R
x <- numeric(5)
for (i in 1:5) x[i] <- 1 # Sets x to all 1's
lapply(seq_along(x), function(i) x[i] <- 1) # does nothing b/c of scope differences