groupingsets | R Documentation |
Functions for working with Grouping Sets, specifically as specified in the [Presto documentation](https://prestodb.io/docs/current/sql/select.html#group-by-clause).
gs_bool_to_group_number(x) grouping_number(all_cols, included_cols) grouping_parser(all_cols) filter_grouping_set( .x, all_grouping_cols, group, .group_number_col = grouping_number )
x |
a logical vector to convert into a grouping set number |
all_cols |
all of the grouping columns |
included_cols |
the group with the desired columns |
.x |
a data.frame-like object |
all_grouping_cols |
the columns included in the grouping sets |
group |
the columns included in the desired group |
.group_number_col |
the column containing the grouping number |
The grouping set number will correspond to the output of 'grouping' in Presto.
a single number indicating the grouping set corresponding to the bool
the grouping number
a function that will parse grouping columns
the parsed data frame
gs_bool_to_group_number(c(TRUE, FALSE, FALSE)) grouping_number( c("origin_state", "origin_zip", "destination_state"), "origin_state" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.