0

when "library(tidyverse)", console prompot like this:

> library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
<U+2713> tibble  2.1.3     <U+2713> purrr   0.3.3
<U+2713> tidyr   1.0.0     <U+2713> stringr 1.4.0
<U+2713> readr   1.3.1     <U+2713> forcats 0.4.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
x stats::filter() masks dplyr::filter()
x stats::lag()    masks dplyr::lag()

and my question is, why not like this:

x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
drrui
  • 1
  • @jay.sf As far as I know,the package which loaded later will masks the one before . So, did I make a mistake ? – drrui Jan 15 '20 at 08:00
  • @drrui you are correct, the most recent package wins. And it can be confounding when you are miles down in a script and a conflict arises and you never noticed the message when you ran your ten `library()` functions at the outset. You should look at the package `conflicted`, it does not solve the problem, but will raise a meaningful error at your method when you run that line of code and suggest options to choose from to resolve the conflict! Read this: https://www.tidyverse.org/blog/2018/06/conflicted/ – sconfluentus Jan 15 '20 at 08:07

0 Answers0