Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bit_setops

bit set operations


Description

Fast versions of union, intersect, setdiff, symmetric difference and setequal for integers.

Usage

bit_union(x, y)

bit_intersect(x, y)

bit_setdiff(x, y)

bit_symdiff(x, y)

bit_setequal(x, y)

Arguments

x

an integer vector

y

an integer vector

Details

determines the range of the integers and checks if the density justifies use of a bit vector; if yes, uses a bit vector for finding duplicates; if no, falls back to union, intersect, setdiff, union(setdiff(x,y),setdiff(y,x)) and setequal

Value

an integer vector

Functions

  • bit_union: union

  • bit_intersect: intersection

  • bit_setdiff: asymmetric difference

  • bit_symdiff: symmetricx difference

  • bit_setequal: equality

See Also

Examples

bit_union(1:2, 2:3)
bit_intersect(1:2, 2:3)
bit_setdiff(1:2, 2:3)
bit_symdiff(1:2, 2:3)
bit_setequal(1:2, 2:3)
bit_setequal(1:2, 2:1)

bit

Classes and Methods for Fast Memory-Efficient Boolean Selections

v4.0.4
GPL-2 | GPL-3
Authors
Jens Oehlschlägel [aut, cre], Brian Ripley [ctb]
Initial release
2020-08-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.