I recently read some source code for a R package called \'pathifier\'. In the source code, it uses the percent sign.
if (0 %in% xs) {
si <- NULL
cat(file = l
The in reserved word can only be used in for loops. The %in% function is different. As noted in the documentation at ?"%in%", is defined as:
"%in%" <- function(x, table) match(x, table, nomatch = 0) > 0
So, it is essentially match. In English, x %in% y returns a vector of logical of the same length as x, with TRUE every time the corresponding element of x exists at least once in y.
The reason why there are % around it is to mark it as a "infix" operator. (I don't know if that is the exact term.)