1

I'm installing tidyverse and getting this conflict error message. How should I resolve it?

✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()

I have already tried to install dplyr through the install package but I still keep getting this prompt

d.b
  • 32,245
  • 6
  • 36
  • 77
Galadriel
  • 17
  • 4
  • 1
    This just means that `dplyr` and `stats` packages both have functions named `filter()` and `lag()`. You don't need to uninstall the packages. If you need to use either of those functions, you should specify which package version you want to use, i.e. `dplyr::filter`. – TJ87 Oct 03 '19 at 19:26

1 Answers1

0

If we have multiple packages loaded with the same function, use the :: in the pipe to specify the package name. A common type of issue occurs when plyr is also loaded as there is summarise/mutate functions that are common between these packages

library(dplyr)
mtcars %>%
   dplyr::select(mpg, cyl) %>%
   group_by(cyl) %>%
   dplyr::summarise(mpg = sum(mpg))
akrun
  • 874,273
  • 37
  • 540
  • 662