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.
Examples
df <- duckdb_tibble(a = 1, b = 1, c = 1, d = "a", e = "a", f = "a")
relocate(df, f)
#> # A duckplyr data frame: 6 variables
#> f a b c d e
#> <chr> <dbl> <dbl> <dbl> <chr> <chr>
#> 1 a 1 1 1 a a