I am trying to rename a column using dplyr::rename, but failing.. 
library(dplyr)
cars %>% 
  filter(speed > 20) %>% 
  rename(speed = new_speed)
# Error: Unknown variables: new_speed.
Any ideas what's wrong there?
It's the other way
cars %>% 
  filter(speed > 20) %>% 
  rename(new_speed = speed)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With