relocate.duckplyr_df: Change column order

View source: R/relocate.R

relocate.duckplyr_dfR Documentation

Change column order

Description

This is a method for the dplyr::relocate() generic. See "Fallbacks" section for differences in implementation. Use relocate() to change column positions, using the same syntax as select() to make it easy to move blocks of columns at once.

Usage

## S3 method for class 'duckplyr_df'
relocate(.data, ..., .before = NULL, .after = NULL)

Arguments

.data

A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details.

...

<tidy-select> Columns to move.

.before, .after

<tidy-select> Destination of columns selected by .... Supplying neither will move columns to the left-hand side; specifying both is an error.

Fallbacks

There is no DuckDB translation in relocate.duckplyr_df()

  • with a selection that returns no columns.

These features fall back to dplyr::relocate(), see vignette("fallback") for details.

See Also

dplyr::relocate()

Examples

df <- duckdb_tibble(a = 1, b = 1, c = 1, d = "a", e = "a", f = "a")
relocate(df, f)

duckdblabs/duckplyr documentation built on Feb. 20, 2025, 1:33 p.m.