merge_list | R Documentation |
Merge lists with different or intersecting names
merge_list(x, y, keep = c("x", "y"), null = c("ignore", "drop", "keep")[1:2])
x , y |
Lists to merge |
keep |
When matching names are found, from which object should the
values be retained; |
null |
Method for handling
|
x <- list(a = 1, b = 2, c = NULL, d = NULL)
y <- list(a = 2, b = NULL, c = 3)
# compared to:
utils::modifyList(x, y)
utils::modifyList(x, y, keep.null = TRUE)
merge_list(x, y)
merge_list(x, y, keep = "y")
merge_list(x, y, null = "drop")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.