notNA: Return a value only if another is not NA

Description Usage Arguments Value Note

View source: R/utils.R

Description

Return a value only if another is not NA

Usage

1
notNA(x, trueValue, defaultValue = NA)

Arguments

x

The value to test for NA

trueValue

The value to return if x is not NA

defaultValue

The value to return if x is NA

Value

defaultValue if x is NA or trueValue if x is not NA

Note

Not terribly different from an ifelse but is more graceful with NULL values


Hackout2/repijson documentation built on May 6, 2019, 9:48 p.m.