Skip to content

Get quantile value.

Source code

Description

Get quantile value.

Usage

<Expr>$quantile(quantile, interpolation = "nearest")

Arguments

quantile Either a numeric value or an Expr whose value must be between 0 and 1.
interpolation One of “nearest”, “higher”, “lower”, “midpoint”, or “linear”.

Details

Null values are ignored and NaNs are ranked as the largest value. For linear interpolation NaN poisons Inf, that poisons any other value.

Value

Expr

Examples

library(polars)

pl$DataFrame(x = -5:5)$
  select(pl$col("x")$quantile(0.5))
#> shape: (1, 1)
#> ┌─────┐
#> │ x   │
#> │ --- │
#> │ f64 │
#> ╞═════╡
#> │ 0.0 │
#> └─────┘