Skip to content

Aggregate the columns of this LazyFrame to their sum values

Description

Aggregate the columns of this LazyFrame to their sum values

Usage

<LazyFrame>$sum()

Value

A polars LazyFrame

Examples

library("polars")

lf <- pl$LazyFrame(a = 1:4, b = c(1, 2, 1, 1))
lf$sum()$collect()
#> shape: (1, 2)
#> ┌─────┬─────┐
#> │ a   ┆ b   │
#> │ --- ┆ --- │
#> │ i32 ┆ f64 │
#> ╞═════╪═════╡
#> │ 10  ┆ 5.0 │
#> └─────┴─────┘