Get a boolean mask of the local maximum peaks
Description
Get a boolean mask of the local maximum peaks
Usage
<Expr>$peak_max()
Value
A polars expression
Examples
library("polars")
df <- pl$DataFrame(x = c(1, 2, 3, 2, 3, 4, 5, 2))
df$with_columns(peak_max = pl$col("x")$peak_max())
#> shape: (8, 2)
#> ┌─────┬──────────┐
#> │ x ┆ peak_max │
#> │ --- ┆ --- │
#> │ f64 ┆ bool │
#> ╞═════╪══════════╡
#> │ 1.0 ┆ false │
#> │ 2.0 ┆ false │
#> │ 3.0 ┆ true │
#> │ 2.0 ┆ false │
#> │ 3.0 ┆ false │
#> │ 4.0 ┆ false │
#> │ 5.0 ┆ true │
#> │ 2.0 ┆ false │
#> └─────┴──────────┘