Skip to content

Instantly share code, notes, and snippets.

@gadenbuie
Last active January 16, 2018 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gadenbuie/c68dc70b8cef371c1881d8d2ecdc1b7a to your computer and use it in GitHub Desktop.
Save gadenbuie/c68dc70b8cef371c1881d8d2ecdc1b7a to your computer and use it in GitHub Desktop.
library(purrr)
l1 <- list(a = list(a1 = 1:10))
l2 <- list(a = list(a2 = 10:20))
list_merge(l1, l2)
#' But both `l1` and `l2` are named... so arguments should be named?
list_merge(x = l1, y = l2)
#' Oh, l2 is implicitly unnamed because it's in dots
list_merge(l1, y = l2)
#' But what I *really* wanted was this
list_modify(l1, rlang::splice(l2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment