Description Usage Arguments Value Examples
Concatenates two lists, preserving order but dropping elements with
duplicated names from the second list. If the second parameter is not a list,
it will be converted to one with as.list
. Names must be unique within each
list but may be (and probably are) duplicated between them. Unnamed elements
are allowed and are always kept.
1 2 |
x |
A list |
y |
A value to merge, general a list but if not it will be converted to
a list using |
... |
Unused, present only for compatibility with the generic. |
A list equal to the first list followed by the second list without any of its named elements already included in the first list.
1 2 3 4 5 6 7 8 9 10 11 12 | first <- list( "x1", x2name="x2", shared3="in x", "x4" )
second <- list( "y1", y2name="y2", shared3="in y", "y4" )
combined <- merge( first, second )
want <- list( "x1", x2name="x2", shared3="in x", "x4",
"y1", y2name="y2", "y4" )
all.equal( combined, want )
#> TRUE
charVec <- c( "y1", y2name="y2", shared3="in y", "y4" )
combinedWithVec <- merge( first, charVec )
all.equal( combinedWithVec, want )
#> TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.