R: Conditional Element Selection for 'ff' vectors.

ffifelse {ffbase} | R Documentation

## Conditional Element Selection for `ff` vectors.

### Description

Similar as `ifelse` in the base package but only works with yes and no as `ff` vectors.

### Usage

    ffifelse(test, yes, no)

### Arguments

`test` | logical or boolean `ff` vector
`yes` | an `ff` vector with return values for true elements of test. If too short, their elements are recycled.
`no` | an `ff` vector with return values for false elements of test. If too short, their elements are recycled.

### Value

An ff vector of the same length as `test`.

### See Also

`ifelse`

### Examples

    data(iris)
    ffiris <- as.ffdf(iris)
    ffifelse(ffiris$Sepal.Length < 5, TRUE, NA)
    ffifelse(ffiris$Sepal.Length < 5, factor(rep("abc", nrow(ffiris))), NA)
    ffifelse(ffiris$Sepal.Length < 5, Sys.Date(), factor("abc"))
    ffifelse( ffiris$Sepal.Length < 5, Sys.Date(), ff(seq.Date( Sys.Date()+1
            , Sys.Date()+nrow(ffiris), by = "day")))

[Package ffbase version 0.13.1 Index]