I have two variables, key
and value
, and I want to add them as a key/value pair to a list:
key = "width"
value = 32
mylist = list()
mylist$key = value
The result is this:
mylist
# $key
# [1] 32
But I would like this instead:
mylist
# $width
# [1] 32
How can I do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…