Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

features with multiple variables #107

Open
atsyplenkov opened this issue Mar 15, 2021 · 0 comments
Open

features with multiple variables #107

atsyplenkov opened this issue Mar 15, 2021 · 0 comments

Comments

@atsyplenkov
Copy link

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.


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
@atsyplenkov atsyplenkov closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2023
@njtierney njtierney reopened this Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants