0

I don't know why suddenly I have started getting error in using everything() while reordering the columns in select().

library(tidyverse)
mtcars %>% 
  select(hp, everything())

Error in select(., hp, everything()) : unused arguments (hp, everything())

iris %>% 
  select(Petal.Width, everything())

Error in select(., Petal.Width, everything()) : unused arguments (Petal.Width, everything())

Is there some change in everything() or select() or am I doing some very stupid mistake ?

ViSa
  • 1,563
  • 8
  • 30
  • 4
    Check `conflicts()` to make sure you are using `dplyr::select` and not a different `select` function from some other package. If you loaded another package after `dplyr` that has a function named `select`, it might be masking `dplyr::select. – Gregor Thomas Mar 18 '21 at 18:03
  • 1
    You could also verify - does it work without the `everything()`? And does `mtcars %>% dplyr::select(hp, everything())` work? – Gregor Thomas Mar 18 '21 at 18:04
  • 1
    Thanks @GregorThomas you are right, I didn't think of checking conflicts on `select()` rather i was thinking the same for `everything()`. – ViSa Mar 18 '21 at 18:14
  • I can't reproduce the error. I think @GregorThomas was correct when he suggested a conflict. – Limey Mar 18 '21 at 18:33
  • @Limey, yes it was a conflict from `MASS` package. – ViSa Mar 20 '21 at 07:33

0 Answers0