transmute.duckplyr_df: Create, modify, and delete columns

View source: R/transmute.R

transmute.duckplyr_dfR Documentation

Create, modify, and delete columns

Description

This is a method for the dplyr::transmute() generic. See "Fallbacks" section for differences in implementation. transmute() creates a new data frame containing only the specified computations. It's superseded because you can perform the same job with mutate(.keep = "none").

Usage

## S3 method for class 'duckplyr_df'
transmute(.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.

...

<data-masking> Name-value pairs. The name gives the name of the column in the output.

The value can be:

  • A vector of length 1, which will be recycled to the correct length.

  • A vector the same length as the current group (or the whole data frame if ungrouped).

  • NULL, to remove the column.

  • A data frame or tibble, to create multiple columns in the output.

Fallbacks

There is no DuckDB translation in transmute.duckplyr_df()

  • with a selection that returns no columns:

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

See Also

dplyr::transmute()

Examples

library(duckplyr)
transmute(mtcars, mpg2 = mpg*2)

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