Skip to content

This is a method for the dplyr transmute() generic. It is translated to the j argument of [.data.table.

Usage

# S3 method for dtplyr_step
transmute(.data, ...)

Arguments

.data

A lazy_dt().

...

<data-masking> Name-value pairs. The name gives the name of the column in the output, and the value should evaluate to a vector.

Examples

library(dplyr, warn.conflicts = FALSE)

dt <- lazy_dt(dplyr::starwars)
dt %>% transmute(name, sh = paste0(species, "/", homeworld))
#> Source: local data table [87 x 2]
#> Call:   `_DT38`[, .(name = name, sh = paste0(species, "/", homeworld))]
#> 
#>   name           sh            
#>   <chr>          <chr>         
#> 1 Luke Skywalker Human/Tatooine
#> 2 C-3PO          Droid/Tatooine
#> 3 R2-D2          Droid/Naboo   
#> 4 Darth Vader    Human/Tatooine
#> 5 Leia Organa    Human/Alderaan
#> 6 Owen Lars      Human/Tatooine
#> # … with 81 more rows
#> 
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results