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")
Run the code above in your browser using DataLab