Minus.names: Minus names

%-%R Documentation

Minus names

Description

Subtract names from names

Usage

x %-% y

Arguments

x

Character vector (likely named) to subtract from

y

Subtracting character vector

Details

Instead of 'x', the function uses 'names(x)'. If 'x' has no names, they will be assigned from values.

Value

Character vector

Author(s)

Alexey Shipunov

Examples

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

shipunov documentation built on Feb. 16, 2023, 9:05 p.m.