select.duckplyr_df: Keep or drop columns using their names and types

View source: R/select.R

select.duckplyr_dfR Documentation

Keep or drop columns using their names and types

Description

This is a method for the dplyr::select() generic. See "Fallbacks" section for differences in implementation. Select (and optionally rename) variables in a data frame, using a concise mini-language that makes it easy to refer to variables based on their name (e.g. a:f selects all columns from a on the left to f on the right) or type (e.g. where(is.numeric) selects all numeric columns).

Usage

## S3 method for class 'duckplyr_df'
select(.data, ...)

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> One or more unquoted expressions separated by commas. Variable names can be used as if they were positions in the data frame, so expressions like x:y can be used to select a range of variables.

Fallbacks

There is no DuckDB translation in select.duckplyr_df()

  • with no expression,

  • nor with a selection that returns no columns.

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

See Also

dplyr::select()

Examples

library(duckplyr)
select(mtcars, mpg)

duckdblabs/duckplyr documentation built on March 5, 2025, 3:46 a.m.