Consider the following code
names = c("1","2","3")
values = c(1.0,1.5,0.5)
list(names = values)
This produces the following list
$names
[1] 1.0 1.5 0.5
But the list I desire is:
$`1`
[1] 1
$`2`
[1] 1.5
$`3`
[1] 0.5
In other words, list("1"=1.0,"2"=1.5,"3"=0.5)
So, how can I create such a list by starting with variables names and values as above?