Skip to content

Aggregate the columns to a unique quantile value

Description

Aggregate the columns to a unique quantile value

Usage

<LazyFrame>$quantile(
  quantile,
  interpolation = c("nearest", "higher", "lower", "midpoint", "linear")
)

Arguments

quantile Quantile between 0.0 and 1.0.
interpolation Interpolation method.

Value

A polars LazyFrame

Examples

library("polars")

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