This calls modifyList iteratively using Reduce, so it can handle >2 lists. The subsequent list elements that share a name will override previous list elements with that same name. It also will handle the case where any list is a NULL

modifyList2(...)

Arguments

...

One or more named lists.

Details

Simply a convenience around Reduce(modifyList, list(...)), with some checks.

Examples

modifyList2(list(a = 1), list(a = 2, b = 2))
#> $a #> [1] 2 #> #> $b #> [1] 2 #>
modifyList2(list(a = 1), NULL, list(a = 2, b = 2))
#> $a #> [1] 2 #> #> $b #> [1] 2 #>
modifyList2(list(a = 1), NULL, list(a = 2, b = 2), list(a = 3, c = list(1:10)))
#> $a #> [1] 3 #> #> $b #> [1] 2 #> #> $c #> $c[[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 #> #>