With the following code, I am creating a list:
scales <- c(p="hye", r="t3")
details <- list(t=20,y="c", scales)
At the moment the above gives me a list as so:
$t
[1] 20
$y
[1] "c"
[[3]]
p r
"hye" "t3"
However I want a list like so:
$t
[1] 20
$y
[1] "c"
$p
[1] "hye"
$r
[1] "t3"
Since this is going to be reused in a function I want to keep scales as a vector argument that I can then insert into a list. How can I do this?
The solution is: