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

make df the first argument in get_totals to work more seamlessly with dplyr #3

Open
jamesmartherus opened this issue May 26, 2020 · 1 comment

Comments

@jamesmartherus
Copy link

Tidyverse functions generally take the data argument first, making it easier to use the %>% operator. For example:

dec13_excerpt <- dec13_excerpt %>% mutate(fake_weight = coalesce(llweight, cellweight))
get_totals("q1", dec13_excerpt, wt = c("weight", "fake_weight"), include_unw = TRUE)

becomes:

dec13_excerpt <- dec13_excerpt %>%
 mutate(fake_weight = coalesce(llweight, cellweight)) %>%
 get_totals("q1", wt = c("weight", "fake_weight"), include_unw = TRUE)

Happy to submit a PR if you all are interested. This change could be relevant to other functions as well, I haven't checked.

@arnoldlcl
Copy link

Thanks for raising this issue! get_totals() was one of the first functions we made and it wasn't designed from the ground up to work with tidyverse and piping. We've been considering making this change in the next release but it would require updating a lot of other bits of code on our end as well, so it's something we need to spec out properly.

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