-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
evaluate variables without curleys #426
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Ready for review, I think |
Here are two examples how code looked before, and what's the "new" way of writing the code with the changes made in this PR: # old example
my_filter <- function(data, condition) {
data_filter(data, {condition})
}
my_filter(mtcars, "am != 0")
# new example
my_filter <- function(data, condition) {
data_filter(data, condition)
}
my_filter(mtcars, "am != 0")
# old example
my_filter <- function(data, variable) {
data_filter(data, {variable} <= 20)
}
my_filter(mtcars, "mpg")
# new example
my_filter <- function(data, variable) {
variable <- paste0(variable, " <= 20")
data_filter(data, variable)
}
my_filter(mtcars, "mpg")
# or...
my_filter <- function(data, variable) {
data_filter(data, variable)
}
my_filter(mtcars, "mpg <= 20") |
I didn't have time to review yet but I suppose this solves #309? |
Not sure, might be. It changes some of the behaviour in general, by replacing curley-braces evaluation with string-/character-variable evaluation (similar to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, a bit hard to review with all the if
conditions but the tests are quite complete
Co-authored-by: Etienne Bacher <[email protected]>
Co-authored-by: Etienne Bacher <[email protected]>
Co-authored-by: Etienne Bacher <[email protected]>
@etiennebacher @DominiqueMakowski I have a proposal how to get rid of the nasty curley braces in
data_filter()
and keeping/maximizing the flexibility... WDYT?Created on 2023-05-27 with reprex v2.0.2