Normally when I want to look up a function's documentation in R
, I can just type ?lm
, or to do a search for it among various packages, I can type ??lm
. However, this does not appear to work for infix operators. For example, when I do ?%*%
, I get the following message.
> ?%*%
Error: unexpected SPECIAL in "?%*%"
Is there a way to look up documentation for such functions / operators in general in R
?
Infix operators (also called “infix functions”) provide that different format, a syntax for pairing arguments while providing a mathematical order of expressions recognized by the program.
%/% gives Quotient. So 6 %% 4 = 2. In your example b %% a , it will vectorised over the values in “a”
For basic operators you need to put quotes around them.
Also here is a list of R base package functions for you to play around with.
?"%*%"
# matmult {base} R Documentation
# Matrix Multiplication ...
? "'"
# Quote
# Quotes {base} R Documentation
# Quotes ...
Also has hadley mentioned:
?"?"
# Question {utils} R Documentation
# Documentation Shortcuts ...
?"??"
# help.search {utils} R Documentation
# Search the Help System
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With