How can I create a list based on a character vector of names of objects that are themselves lists?
Minimal example
l1 <- list(letters, 1:10)
l2 <- list(LETTERS, 1:5)
list_names <- as.list(paste0("l", 1:2))
list(list_names)
[[1]]
[[1]][[1]]
[1] "l1"
[[1]][[2]]
[1] "l2"
The result is not what I want. I guess I somehow need to use backticks or soemthing such that l1
and l2
are not interpreted as character strings.
How would I do that?