Test Case:
library(dplyr)
library(plyr)
library(dplyr)
mtcars%>%rename(x=gear)
This gives error. Any help would be greatly appreciated.
Test Case:
library(dplyr)
library(plyr)
library(dplyr)
mtcars%>%rename(x=gear)
This gives error. Any help would be greatly appreciated.
Based on @hadley's tweet. Best answer is to load plyr ALWAYS before dplyr, AND not load plyr again. Pasting his tweet for reference.
Hadley Wickham @hadleywickham Jul 27
@gunapemmaraju just load plyr before dplyr?
and not load dplyr again
–
Potation I have this problem when require plyr again sourcing files. You can do
if("dplyr" %in% (.packages())){
detach("package:dplyr", unload=TRUE)
detach("package:plyr", unload=TRUE)
}
library(plyr)
library(dplyr)
© 2022 - 2024 — McMap. All rights reserved.
plyr
afterdplyr
, you can domtcars %>% dplyr::rename(x=gear)
to usedplyr
'srename
function. However, it's generally better to loadplyr
beforedplyr
(assuming you want to use functions from both packages), sincedplyr
is faster. Or, you can just loaddplyr
and then use, for example,plyr::rename
if you want a specificplyr
function that's masked bydplyr
. – Subminiaturedetach()
– Chuch