I am a little bit puzzled when using lists of lists. If I try the following code, I get an error and I don't understand why:
library(tibble)
data <- list()
data[1][[1]] <- tibble(year = rep(2010,4)) # works
data[1][[2]] <- tibble(year = rep(2011,4)) # gives me an error
# Warning message:
# In data[1][[2]] <- tibble(year = rep(2011, 4)) :
# number of items to replace is not a multiple of replacement length
Any help on this, would be appreciated.