-
-
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
data_modify() gains .it and .at #478
Conversation
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.
@etiennebacher what do you think? If you like this idea, I would add tests.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #478 +/- ##
==========================================
+ Coverage 89.40% 89.47% +0.06%
==========================================
Files 72 72
Lines 5419 5453 +34
==========================================
+ Hits 4845 4879 +34
Misses 574 574 ☔ View full report in Codecov by Sentry. |
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.
Thanks @strengejacke, I have several comments relative to the docs and error behavior.
I'm also wondering if we should have an additional function to be used in data_modify()
so that we can clearly make the distinction between what is passed in ...
and the other args (something similar to across()
in dplyr
). For example, I think that
mtcars |>
data_modify(
x = mpg + 2,
y = center(drat),
group_expr(
.if = is.numeric,
.modify = as.factor
)
)
is more readable than
mtcars |>
data_modify(
x = mpg + 2,
y = center(drat),
.if = is.numeric,
.modify = as.factor
)
(I just use group_expr()
as a placeholder here, I think it should have another name). What do you think?
Thanks, I addressed all your comments. Regarding |
Maybe, but then should we forbid the use of |
Yes, I'm not decided whether to allow newly defined variables in But maybe we decide on this later, after some experience with this feature? |
For example you could create/modify variables as usual, including some numeric variables, and then say "ok let's If we forbid the use of |
hm, makes sense. I think we should change to that default behaviour. |
Created on 2024-02-06 with reprex v2.1.0