powered by
Lazily aggregate a DuckDB relation object
rel_aggregate(rel, groups, aggregates)
the now aggregated duckdb_relation object
duckdb_relation
the DuckDB relation object
a list of DuckDB expressions to group by
a (optionally named) list of DuckDB expressions with aggregates to compute
con <- DBI::dbConnect(duckdb()) rel <- rel_from_df(con, mtcars) aggrs <- list(avg_hp = expr_function("avg", list(expr_reference("hp")))) rel2 <- rel_aggregate(rel, list(expr_reference("cyl")), aggrs)
Run the code above in your browser using DataLab