either: Return y if x satisfies given condition, otherwise return x

View source: R/algorithm.R

eitherR Documentation

Return y if x satisfies given condition, otherwise return x

Description

Return y if x satisfies given condition, otherwise return x

Usage

either(x, y, condition = is.na)

Arguments

x

target value

y

alternatively returned value

condition

a function return logical values for each x

Value

x or y, whose length is euqal to length_x


hmito/hmRLib documentation built on March 13, 2024, 9:41 p.m.