I wanted to ask why I get this error while initializing a list of for example vectors or some other type and how can I fix it?
> l <- list()
> l[[1]][1] <- 1
Error in `*tmp*`[[1]] : subscript out of bounds
This is the whole code I need, in fact I want a list of vectors like this:
mcorrelation <- list()
for(k in 1:7){
for (ind in 1:7){
mcorrelation[[k]][ind] <- co$estimate
}
}
Should I initialize the whole list in advance or is there any other way for not getting this error?