Learn R Programming

vectra (version 0.6.2)

distinct: Keep distinct/unique rows

Description

Keep distinct/unique rows

Usage

distinct(.data, ..., .keep_all = FALSE)

Value

A vectra_node with unique rows.

Arguments

.data

A vectra_node object.

...

Column names (unquoted). If empty, uses all columns.

.keep_all

If TRUE, keep all columns (not just those in ...).

Details

Uses hash-based grouping with zero aggregations. When .keep_all = TRUE with a column subset, falls back to R's duplicated() with a message.

This is a materializing operation.

Examples

Run this code
f <- tempfile(fileext = ".vtr")
write_vtr(mtcars, f)
tbl(f) |> distinct(cyl) |> collect()
unlink(f)

Run the code above in your browser using DataLab