sd_group_by.RdNote that unlike dplyr::group_by(), these groups are dropped after
any transformations.
sd_group_by(.data, ...)
sd_ungroup(.data)A sedonadb_dataframe or an object that can be coerced to one.
Named expressions whose unique combination will be used as
groups to potentially compute a future aggregate expression. These are
evaluated in the same way as dplyr::group_by() except .add nor
.drop are supported.
An object of class sedonadb_dataframe
data.frame(letter = c(rep("a", 3), rep("b", 4), rep("c", 3)), x = 1:10) |>
sd_group_by(letter) |>
sd_summarise(x = sum(x))
#> <sedonab_dataframe: ?? x 2>
#> ┌────────┬───────┐
#> │ letter ┆ x │
#> │ utf8 ┆ int64 │
#> ╞════════╪═══════╡
#> │ a ┆ 6 │
#> ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
#> │ b ┆ 22 │
#> ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
#> │ c ┆ 27 │
#> └────────┴───────┘
#> Preview of up to 6 row(s)