I am trying to create a list with the following (nested) structure:
l <- list() for(i in seq(5)) l[[i]] <- list(a=NA,b=NA) > str(l) List of 5 $ :Li
You can use replicate:
replicate
l <- replicate(5, list(a=NA,b=NA), simplify=FALSE)