Description Usage Arguments Value Lifecycle Examples

This is a convenient way of generating sample data. It works similarly to
`replicate(..., simplify = FALSE)`

.

1 |

`.n` |
Number of times to run expressions |

`...` |
Expressions to re-run. |

A list of length `.n`

. Each element of `...`

will be
re-run once for each `.n`

.

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)`

.

`rerun()`

is in the questioning lifecycle stage because we are no
longer convinced NSE functions are a good fit for purrr. Also,
`rerun(n, x)`

can just as easily be expressed as `map(1:n, ~ x)`

(with the added benefit of being passed the current index as
argument to the lambda).

1 2 3 4 |

tidyverse/purrr documentation built on Jan. 11, 2019, 12:14 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.