etiennebacher / tidypolars

Get the power of polars with the syntax of the tidyverse
https://tidypolars.etiennebacher.com
Other
172 stars 3 forks source link

`.data[[<varname>]]` should work #93

Closed etiennebacher closed 7 months ago

etiennebacher commented 7 months ago
library(dplyr, warn.conflicts = FALSE)
library(tidypolars)

vars <- c("mass", "height")

starwars |> 
  as_polars_df() |> 
  mutate(prod = .data[[vars[[1]]]] * .data[[vars[[2]]]])
#> Error in `mutate()`:
#> ! Unknown function: [[