setop: Optimized operations of sets of character-vectors

Description Usage Arguments Details Value Examples

Description

Sort and use pre-sorted character vectors in set-operations

Usage

1
2
3

Arguments

x

an unsorted vectors of strings

pop

a sorted vector of strings

Details

By default, sorting is done lexicographically in R. The routine sortAscii does sorting accoring to the ASCII-order as done in C/C++.

For routines intersectPresort and setdiffPresort the first argument has to be sorted according to ASCII-order. This first argument is expected to be large compared to the second argument. Both functions are wrappers for optimized C++-functions performing the set-operation.

Value

An character-vector. In case of intersectPresort and setdiffPresort, these vectors are unnamed.

Examples

1
2
3
4
5
AA <- matrix( sample( c(LETTERS, letters), 10*30000, rep=TRUE ), ncol=10 )
A <- unique(apply(AA, 1, paste, collapse=""))
B <- sample(AA, 100, replace=FALSE); B <- c(B, "1234")

res <- intersectPresort( sortAscii(A), B )

geecc documentation built on April 28, 2020, 8:19 p.m.