Description Usage Arguments Details Value Examples
1 2 3 4 5 | nest_by(.data, ..., .key = "data")
nest_by_at(.data, ..., .key = "data")
nest_by_if(.data, ..., .key = "data")
|
.data |
a tbl |
... |
Variables to nest by. |
.key |
the name of the list column |
Conceptually, nest_by
is the same as group_by()
+ tidyr::nest()
.
A tbl with one row per unique combination of the grouping variables. The first columns are the grouping variables, followed by a list column of tibbles with matching rows of the remaining columns.
1 2 3 4 5 6 7 8 | starwars %>%
nest_by(species, homeworld)
starwars %>%
nest_by_at(vars(ends_with("_color")))
starwars %>%
nest_by_if(is.numeric)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.