bit_rangediff: bit range difference

Description Usage Arguments Details Value See Also Examples

View source: R/bitsort.R

Description

Fast version of setdiff(rx[1]:rx[2], y).

Usage

1
bit_rangediff(rx, y, revx = FALSE, revy = FALSE)

Arguments

rx

range of integers given as ri or as a two-element integer

y

an integer vector of elements to exclude

revx

FALSE as is, TRUE to reverse the direction and sign of rx

revy

FALSE as is, TRUE to reverse the direction and sign of y

Details

determines the range of the integers y and checks if the density justifies use of a bit vector; if yes, uses a bit vector for the set operation; if no, falls back to a quicksort and merge_rangediff

Value

an integer vector

See Also

bit_setdiff, merge_rangediff

Examples

1
2
3
4
bit_rangediff(c(1L,6L), c(3L,4L))
bit_rangediff(c(6L,1L), c(3L,4L))
bit_rangediff(c(6L,1L), c(3L,4L), revx=TRUE)
bit_rangediff(c(6L,1L), c(3L,4L), revx=TRUE, revy=TRUE)

bit documentation built on Aug. 4, 2020, 9:06 a.m.