I have two vectors and I want to create a list in R where one vector are the keys and the other the values. I thought that I was going to find easily the answer in my books
Hong's output is wrong.
Should use vals[["key42"]]
> vals[["key42"]] [1] 42 vals <- 1:1000000 keys <- paste0("key", 1:1000000) names(vals) <- keys vals["key42"] key42 42