Value Matching for ff objects
ffmatch
returns an ff vector of the positions of (first) matches of its first argument in its second.
Similar as match
. ffdfmatch
allows to match ffdf objects by paste
-ing together the columns of the ffdf and matching on the pasted column and
returns an ff vector of the positions of (first) matches of its first argument in its second.%in%
returns a logical ff vector indicating if there is a match or not for its left operand.
ffdf objects are also allowed in the left and right operand of the %in%
operator. See the examples.
ffmatch( x, table, nomatch = NA_integer_, incomparables = NULL, trace = FALSE, ... ) ffdfmatch( x, table, nomatch = NA_integer_, incomparables = NULL, trace = FALSE, ... ) x %in% table
x |
a |
table |
a |
nomatch |
the value to be returned in the case when no match is found. Note that it is coerced to |
incomparables |
a vector of values that cannot be matched. Any value in |
trace |
logical indicating to show on which chunk the function is computing |
... |
other parameters passed on to chunk |
An ff vector of the same length as x
. An integer vector giving the position in table of the first match if there is a match, otherwise nomatch
.
## Basic example of match.ff x.ff <- ffmatch( as.ff(as.factor(c(LETTERS, NA))) , as.ff(as.factor(c("C","B","Z","X","HMM","Nothing",NA))) , trace=TRUE , BATCHBYTES=20) class(x.ff) x <- match(c(LETTERS, NA), c("C","B","Z","X","HMM","Nothing",NA)) table(x.ff[] == x, exclude=c()) ## ffdfmatch also allows to input an ffdf data(iris) ffiris <- as.ffdf(iris) ffirissubset <- as.ffdf(iris[c(1:10, nrow(iris)), ]) ffdfmatch(ffiris, ffirissubset, trace=TRUE, BATCHBYTES=500) ## %in% is masked from the base package letter <- factor(c(LETTERS, NA)) check <- factor(c("C","B","Z","X","HMM","Nothing",NA)) letter %in% check as.ff(letter) %in% as.ff(check) ffiris %in% ffirissubset
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.