I am pretty confused about the meaning of the %Something%
operators.
How can one store a binary operator in a variable?
Something like...
binary_operator = store.binary(%in%)
c(3,9,4,1,7) binary_operator c(1:5) # would behave alike "c(3,9,4,1,7) %in% c(1:5)"
or something like
library(foreach)
binary_operator = expression(%do%) # or expression(%dopar%)
...
...
foreach (i=1:6) binary_operator { # would behave alike "foreach (i=1:6) %do% ..."
...
...
}
If you want to define your own infix operator, it must begin and end with
%
. This is so the parser knows how to properly pass the parameters to the function since it not the usual way code is parsed. Also, use the backtick to escape the percent signs in the variable name.