Skip to content

Set a sorted flag on a Series

Source code

Description

Set a sorted flag on a Series

Usage

<Series>$set_sorted(..., descending = FALSE, in_place = FALSE)

Arguments

Ignored.
descending Sort the columns in descending order.
in_place If TRUE, this will set the flag mutably and return NULL. Remember to use options(polars.strictly_immutable = FALSE) before using this parameter, otherwise an error will occur. If FALSE (default), it will return a cloned Series with the flag.

Details

Use $flags to see the values of the sorted flags.

Value

A Series with a flag

Examples

library("polars")

s = as_polars_series(1:4)$set_sorted()
s$flags
#> $SORTED_ASC
#> [1] TRUE
#> 
#> $SORTED_DESC
#> [1] FALSE