3

My question is some packages share the same function name. How can I tell R which package that I want to use this function from?

I tried to load the package that I wanted to use again in the code but it still did not work. My case is the select in MASS and dplyr. I want to use dplyr but the error is always unused argument...

zx8754
  • 46,390
  • 10
  • 104
  • 180
MYjx
  • 3,857
  • 8
  • 36
  • 51

1 Answers1

4

You can use the :: operator:

iris %>%
  head(n = 3) %>%
  dplyr::select(Sepal.Length)

See here for details.

Or detach MASS ala this post.

Community
  • 1
  • 1
Chase
  • 65,190
  • 17
  • 140
  • 160