Skip to content

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

@jamesmartherus

Description

@jamesmartherus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions