without: The relative complement or set difference

Description Usage Arguments Value Note Author(s) Examples

Description

The page decribes different interfaces for the relative complement of x with respect to y, i.e. x\y or x minus y. It is faster than

Usage

1
2
without(x, y)
x %w/o% y

Arguments

x

A character or numeric vector.

y

A character or numeric vector.

Value

The functions returns a vector of the elements in x which does not appear in y.

Note

These functions are identical to setdiff but sometimes more easy to use.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
print(A <- LETTERS[1:10])
print(B <- LETTERS[5:15])

A %w/o% B 
#A %\% B     # More mathematical notation, single backslash only!
without(A, B)
setdiff(A, B)

## Not run: 
library(microbenchmark)
microbenchmark(without(A, B), 
               setdiff(A, B))

## End(Not run)

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.