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

Add compatibility with dplyr programming data masking #129

Closed
Daveyr opened this issue Jul 21, 2020 · 4 comments · Fixed by #132
Closed

Add compatibility with dplyr programming data masking #129

Daveyr opened this issue Jul 21, 2020 · 4 comments · Fixed by #132

Comments

@Daveyr
Copy link

Daveyr commented Jul 21, 2020

With dplyr verbs it is possible to redirect environment variables as data variables, for instance:

var_summary <- function(data, var) {
  data %>%
    summarise(n = n(), min = min({{ var }}), max = max({{ var }}))
}

It would be very helpful if tidyjson verbs could do the same, e.g.

jsonDF <- function(data, object){
  data %>%
    enter_object({{object}}) %>%
    spread_all()
}
@ramiromagno
Copy link
Contributor

I second this.

@colearendt colearendt mentioned this issue Jan 2, 2021
@colearendt
Copy link
Owner

PR that implements this is up! Please give it a try and LMK if any issues! #132

@ramiromagno
Copy link
Contributor

Thank you for your lightning response!

Just a question: in your PR you use rlang::quo, should it not be rlang::enquo?

Suggestion: perhaps add a test too with the embrace operator (as opposed to having only the !!! operator).

@colearendt
Copy link
Owner

colearendt commented Jan 2, 2021 via email

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

Successfully merging a pull request may close this issue.

3 participants