%>%
is an binary infix operator, you need to use it with operands, or you'll recieve an error. Hence the specified usage:
lhs %>% rhs
In you case above, writing ?%>%
will attempt to call %>%
using ?
as your lhs operator. Hence the error ... unexpected SPECIAL ...
. If you, on the other hand, wrap your operator in '...'
or "..."
, it will use the ?
prefix as you intend: showing the help section for that operator.
As an example, try the following in your console:
?< <-- Error: unexpected '<' in "?<"
?'<' <-- OK
?"<" <-- OK
(after first edit of question)
Now, regarding your updated question, where to find appropriate documentation for the pipe operator, I quote this site
Although not required, the tidyr and dplyr packages make use of the
pipe operator %>% developed by Stefan Milton Bache in the R package
magrittr. Although all the functions in tidyr and dplyr can be used
without the pipe operator, one of the great conveniences these
packages provide is the ability to string multiple functions together
by incorporating %>%.
Hence, an appropriate place to begin would be in the documentation for the magrittr
package:
(after second edit of question)
Finally, if we take a look at how the associated tidyr
manual page for the pipe operator is generated, we get our answer to your final edit:
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{\%>\%}
\alias{\%>\%}
\title{Pipe operator}
\usage{
lhs \%>\% rhs
}
\description{
See \code{\link[magrittr]{\%>\%}} for more details.
}
\keyword{internal}
Hence, your help page is supposed to contain a link to the magrittr
help page for the pipe operator, but if you are running from e.g. terminal (are you?), then you will only be shown plain text, in so loosing (or at least not seeing) the link.