0

I'm creating a package, and I'm trying to be smart about the namespace. I also heavily use dplyr for just about everything these days. I understand that I should use:

dplyr::select()

However, I'm not sure what I need to do to use the piping operator:

%>%

The sample code below makes sense:

dplyr::select(mtcars, mpg)

This doesn't (and of course doesn't work):

mtcars dplyr::%>% dplyr::select(mpg)

nrussell
  • 17,956
  • 4
  • 46
  • 60
Kyle Ward
  • 859
  • 1
  • 7
  • 17
  • 2
    The `%>%` operator really comes from `magrittr`. Use the solution from this question: http://stackoverflow.com/questions/27947344/r-use-magrittr-pipe-operator-in-self-written-package – MrFlick Jul 07 '16 at 15:18
  • Thanks! Not sure why I didn't find this issue when searching. – Kyle Ward Jul 07 '16 at 15:23
  • I can imagine search engines have a hard time with `%>%` ;) – Señor O Jul 07 '16 at 15:29

0 Answers0