nest_cols: Nest columns together, preserving rows

Description Usage Arguments Examples

Description

Nest specified columns together, while preserving rows.

Usage

1
nest_cols(data, ..., .key = "data")

Arguments

data

A data frame.

...

A selection of columns to nest together. See the dplyr::select() documentation for more options. Cannot include variable used in grouping.

.key

The name of the new column, as a string or symbol.

Examples

1
2
3
4
5
6
7
library(dplyr)

#Place "Sepal" and "Petal" columns into nests

iris %>%
 nest_cols(starts_with("Sepal"), .key = "Sepal") %>%
 nest_cols(starts_with("Petal"), .key = "Petal")

JakeNel28/nestyr documentation built on May 14, 2019, 7:14 p.m.