Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ffifelse

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

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")))

ffbase

Basic Statistical Functions for Package 'ff'

v0.13.3
GPL-3
Authors
Edwin de Jonge, Jan Wijffels, Jan van der Laan
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.