# NOT RUN {
1:3 %>% reduce(`+`)
1:10 %>% reduce(`*`)
paste2 <- function(x, y, sep = ".") paste(x, y, sep = sep)
letters[1:4] %>% reduce(paste2)
letters[1:4] %>% reduce2(c("-", ".", "-"), paste2)
samples <- rerun(2, sample(10, 5))
samples
reduce(samples, union)
reduce(samples, intersect)
x <- list(c(0, 1), c(2, 3), c(4, 5))
x %>% reduce(c)
x %>% reduce_right(c)
# Equivalent to:
x %>% rev() %>% reduce(c)
# }
Run the code above in your browser using DataLab