Learn R Programming

vectra (version 0.6.2)

arrange: Sort rows by column values

Description

Sort rows by column values

Usage

arrange(.data, ...)

Value

A new vectra_node with sorted rows.

Arguments

.data

A vectra_node object.

...

Column names (unquoted). Wrap in desc() for descending order.

Details

Uses an external merge sort with a 1 GB memory budget. When data exceeds this limit, sorted runs are spilled to temporary .vtr files and merged via a k-way min-heap. NAs sort last in ascending order.

This is a materializing operation.

Examples

Run this code
f <- tempfile(fileext = ".vtr")
write_vtr(mtcars, f)
tbl(f) |> arrange(desc(mpg)) |> collect() |> head()
unlink(f)

Run the code above in your browser using DataLab