x <- rerun(5, x = runif(1), y = runif(5))
x %>% str()
x %>% zip_n() %>% str()
x %>% zip_n() %>% zip_n() %>% str()
x <- list(a = 1:5, b = 5:1)
x %>% zip_n()
x %>% zip_n(.simplify = TRUE)
# Zipping is its own inverse operation
x %>% str()
x %>% zip_n(.simplify = TRUE) %>% zip_n(.simplify = TRUE) %>% str()
# zip2(x, y) is a shortcut for zip_n(list(x, y)). It can be handy
# but doesn't handle names and is not its own inverse.
x %>% zip_n() %>% str()
zip2(1:5, 5:1) %>% str()
Run the code above in your browser using DataLab