bit_rangediff | R Documentation |
Fast version of setdiff(rx[1]:rx[2], y)
.
bit_rangediff(rx, y, revx = FALSE, revy = FALSE)
rx |
range of integers given as |
y |
an integer vector of elements to exclude |
revx |
|
revy |
|
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
an integer vector
bit_setdiff
, merge_rangediff
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.