iif: If-else Replacement Function For Vectors

Description Usage Arguments Examples

View source: R/utils.R

Description

If-else Replacement Function For Vectors

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
iif(x, y, cond = c("is.null", "is.na", "is.nan", "is.blank", "is.zero"))

ifnull(x, y)

ifna(x, y)

ifnan(x, y)

ifblank(x, y)

ifempty(x, y)

ifzero(x, y)

Arguments

x

A vector/list to replace

y

The vector to be replaced with

cond

Condition string, could be 'is.null', 'is.na', 'is.nan', 'is.blank', or 'is.zero'

Examples

1
2
3
4
5
## Not run: 
ifna(c(NA, 1, 4, NA), 0)
# get c(0, 1, 4, 0)

## End(Not run)

madlogos/recharts2 documentation built on May 21, 2019, 11:03 a.m.