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
  • 52,746
  • 12
  • 114
  • 209
MYjx
  • 4,157
  • 9
  • 38
  • 53

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
  • 67,710
  • 18
  • 144
  • 161