sortAscii {geecc} | R Documentation |
Sort and use pre-sorted character vectors in set-operations
sortAscii(x) intersectPresort(pop, x) setdiffPresort(pop, x)
x |
an unsorted vectors of strings |
pop |
a sorted vector of strings |
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.
An character-vector. In case of intersectPresort
and setdiffPresort
, these vectors are unnamed.
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 )