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

result of function mutate_each_ not consisit with old versions #3020

Closed
earthcli opened this issue Aug 13, 2017 · 6 comments
Closed

result of function mutate_each_ not consisit with old versions #3020

earthcli opened this issue Aug 13, 2017 · 6 comments
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@earthcli
Copy link

earthcli commented Aug 13, 2017

mutate_each_(data.frame(t=30:35,x=1:6),funs(CDD=ifelse(.<33,33-.,0)),vars="t")

with dplyr>0.5 it yield t, x, CDD
with dplyr>0.7.2 it yield t, x, t_CDD

mutate_each_(data.frame(t=30:35,x=1:6),funs(CDD=ifelse(.<33,33-.,0)),vars=c("t","x"))
@krlmlr
Copy link
Member

krlmlr commented Aug 22, 2017

Thanks, confirmed.

@lionel-: One fix would be to make vars unnamed in https://github.com/tidyverse/dplyr/pull/2956/files#diff-b5604a13d7d44d0c36969db187e7e5bbR257, this conflicts with #2956 so needs to wait.

@krlmlr krlmlr added the bug an unexpected problem or unintended behavior label Aug 22, 2017
@lionel- lionel- self-assigned this Aug 22, 2017
@krlmlr
Copy link
Member

krlmlr commented Aug 28, 2017

The same happens if more than one function is passed. @earthcli: Can you confirm?

@earthcli
Copy link
Author

@krlmlr Yes, with this example:
mutate_each_(data.frame(t=30:35,x=1:6),funs(CDD=ifelse(.<33,33-.,0),GDD=ifelse(.>33,.-33.,0)),vars="t")
it results: t x t_CDD t_GDD

@krlmlr
Copy link
Member

krlmlr commented Aug 29, 2017

And with dplyr 0.5.0 this was different?

@earthcli
Copy link
Author

@krlmlr Yes, it is different, it results: t x CDD GDD

krlmlr added a commit that referenced this issue Mar 17, 2018
- Improve column name compatibility for `mutate_each()` and `summarize_each()` with dplyr 0.5.0 and earlier in an edge case (#3020).
@lock
Copy link

lock bot commented Sep 13, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants