%-% {shipunov} | R Documentation |
Subtract names from names
x %-% y
x |
Character vector (likely named) to subtract from |
y |
Subtracting character vector |
Instead of 'x', the function uses 'names(x)'. If 'x' has no names, they will be assigned from values.
Character vector
Alexey Shipunov
str(iris[, iris %-% "Species"])
str(iris[, !names(iris) %in% "Species"]) # this is how to make it without %-%
c("apples", "bananas") %-% "apples" # simple character string also works