You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to create my own features with multiple variables. Is it possible? The goal is to apply a function to multiple variables and get one variable in the end.
This is an example where I expected a sum of two columns to be returned.
library(brolgar)
library(dplyr)
feat_tot<-function(x, y, ...){
c(
tot= sum(x, y)
)
}
wages %>%
features_at(.var= vars("ln_wages", "xp"),
features=feat_tot)
#> Warning: 888 errors (1 unique) encountered for feature 1#> [888] argument "y" is missing, with no default#> Warning: 888 errors (1 unique) encountered for feature 2#> [888] argument "y" is missing, with no default#> # A tibble: 888 x 1#> id#> <int>#> 1 31#> 2 36#> 3 53#> 4 122#> 5 134#> 6 145#> 7 155#> 8 173#> 9 206#> 10 207#> # ... with 878 more rows
The text was updated successfully, but these errors were encountered:
Following my twit, I'm submitting an issue.
I was trying to create my own
features
with multiple variables. Is it possible? The goal is to apply a function to multiple variables and get one variable in the end.This is an example where I expected a
sum
of two columns to be returned.The text was updated successfully, but these errors were encountered: