Drop duplicated rows
Description
Drop duplicated rows
Usage
<LazyFrame>$unique(subset = NULL, ..., keep = "any", maintain_order = FALSE)
Arguments
subset
|
A character vector with the names of the column(s) to use to identify
duplicates. If NULL (default), use all columns.
|
…
|
Not used. |
keep
|
Which of the duplicate rows to keep:
|
maintain_order
|
Keep the same order as the original data. Setting this to
TRUE makes it more expensive to compute and blocks the
possibility to run on the streaming engine.
|
Value
LazyFrame
Examples
library("polars")
df = pl$LazyFrame(
x = sample(10, 100, rep = TRUE),
y = sample(10, 100, rep = TRUE)
)
df$collect()$height
#> [1] 100
#> [1] 60
#> [1] 10
#> polars LazyFrame
#> $explain(): Show the optimized query plan.
#>
#> Naive plan:
#> UNIQUE[maintain_order: false, keep_strategy: Last] BY None
#> DF ["x", "y"]; PROJECT */2 COLUMNS; SELECTION: None
#> polars LazyFrame
#> $explain(): Show the optimized query plan.
#>
#> Naive plan:
#> UNIQUE[maintain_order: false, keep_strategy: None] BY None
#> DF ["x", "y"]; PROJECT */2 COLUMNS; SELECTION: None