Merge Lists Overriding Elements of the Same Name
Usage
mergeLists(..., warn.on.NULL = TRUE)
Arguments
- ...
lists
- warn.on.NULL
if TRUE (default) a warning is given if any of the
arguments given to this function is NULL
Value
list containing the elements given in ...
Examples
# merge two lists with different elements
mergeLists(list(a = 1), list(b = 2))
#> $a
#> [1] 1
#>
#> $b
#> [1] 2
#>
# merge two lists with one element of the same name: override element "b"
mergeLists(list(a = 1, b = 2), list(b = 3, c = 4))
#> $a
#> [1] 1
#>
#> $b
#> [1] 3
#>
#> $c
#> [1] 4
#>