
replicate(..., simplify = FALSE)
.rerun(.n, ...)
.n
. Each element of ...
will be
re-run once for each .n
. It There is one special case: if there's a single unnamed input, the second
level list will be dropped. In this case, rerun(n, x)
behaves like
replicate(n, x, simplify = FALSE)
.
10 %>% rerun(rnorm(5))
10 %>%
rerun(x = rnorm(5), y = rnorm(5)) %>%
map_dbl(~ cor(.x$x, .x$y))
Run the code above in your browser using DataLab