在 R 中使用列表似乎很棘手。我不知道引用名称第一部分相同的列表元素是不明确的:
opts = list()
opts$value = NULL
opts$valueDefault = c(1,2,3)
print(opts) # note: displaying the whole list does not reveal
# the element "value"
$valueDefault
[1] 1 2 3
print(opts$value) # with this notation I do not get the correct (intended)
# result
[1] 1 2 3
print(opts[["value"]]) # with this notation I do
NULL