ifelseC: ifelse replacement

Description Usage Arguments Details Examples

View source: R/ifelseR.R

Description

This function is a port of ifelse from base. Usually the behaviour should be identical.

Usage

1
ifelseC(test, yes, no)

Arguments

test

logical vector or an object that can be compressed to a logical vector

yes

numerical, character, integer or logical vector for cases where test is TRUE.

no

numerical, character, integer or logical vector for cases where test is FALSE.

Details

The parameters must have the same length, or, in the case of yes or no, length must be 1.

Examples

1
2
test = c(TRUE,FALSE,NA); yes = c(1,1,1); no = c(2,2,2)
all(ifelseC(test, yes, no) == ifelse(test, yes, no))

ojUtils documentation built on Sept. 21, 2018, 6:25 p.m.