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

Support everything() in transmute() #3215

Closed
mungojam opened this issue Nov 20, 2017 · 3 comments
Closed

Support everything() in transmute() #3215

mungojam opened this issue Nov 20, 2017 · 3 comments
Labels
feature a feature request or enhancement verbs 🏃‍♀️

Comments

@mungojam
Copy link

@mungojam mungojam commented Nov 20, 2017

Following the discussion here, it would be useful to be able to use everything() in transmute so that cases where I want to just add a couple of columns at the start of the tibble are dealt with.

This would then be possible:

library(dplyr)
myTibble <- tibble(
                        c = c(1, 2, 3), 
                        d = c(5, 6, 7)
                     )

fullTibble <- myTibble %>% 
                         transmute(
                                 a = c + 1,  
                                 b = c + 2, 
                                 everything()
                         ) 
#Error in mutate_impl(.data, dots) : 
#Evaluation error: Variable context not set.

I'd actually rather be able to do this with select and remove need for transmute, but if not, then transmute would be next best thing.

@krlmlr krlmlr added feature a feature request or enhancement verbs 🏃‍♀️ labels Dec 12, 2017
@krlmlr
Copy link
Member

@krlmlr krlmlr commented Dec 12, 2017

select() doesn't support mutates by design, so it'd have to be with transmute(). I like the idea, but the next release is planned to be bugfix-only.

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Apr 11, 2018

Let's not mix select and mutate semantics. You can do this I two steps, a mutate followed by a select.

myTibble %>% 
    mutate( a = c + 1,  b = c + 2 ) %>% 
    select(a, b, everything())

@lock
Copy link

@lock lock bot commented Oct 8, 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 Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement verbs 🏃‍♀️
Projects
None yet
Development

No branches or pull requests

3 participants