#### Not in ####
"z" %ni% c("a", "b", "c")
# TRUE
#### Exclusive or ####
TRUE %xor% TRUE
# FALSE
FALSE %xor% FALSE
# FALSE
FALSE %xor% TRUE
# TRUE
#### All-or-nothing ####
TRUE %aon% TRUE
# TRUE
FALSE %aon% FALSE
# TRUE
FALSE %aon% TRUE
# FALSE
# Apply a regular expression/substitution to x:
x <- c("foo", "bar", "dOe", "rei", "mei", "obo")
# where x has an O
x[x %rlike% "O"]
# [1] "foo" "dOe" "obo"
# find x where middle letter is "O"
x[x %rlike% "[a-z]O[a-z]"]
# will print [1] "foo" "dOe"
# Apply a regular expression/substitution to x:
x <- c("foo", "bar", "dOe", "rei", "mei", "obo")
# find x where middle letter is upper-case "O"
x[x %perl% "[a-z]O[a-z]"]
# will print [1] "dOe"
Run the code above in your browser using DataLab