krangl / krangl / nest

nest

fun DataFrame.nest(colSelect: ColumnSelector = { except(*groupedBy().names.toTypedArray()) }, columnName: String = DEF_NEST_COLUMN_NAME): DataFrame

Nest repeated values in a list-variable.

There are many possible ways one could choose to nest colSelect inside a data frame. nest() creates a list of data frames containing all the nested variables: this seems to be the most useful form in practice.

Usage

nest(data, ..., columnName = "data")

Parameters

colSelect - A selection of colSelect. If not provided, all except the grouping variables are selected. You can supply bare variable names, select all variables between x and z with x:z, exclude y with -y. For more options, see the select() documentation.

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