Learn R Programming

ospsuite.utils (version 1.2.0)

ifNotNull: Shortkey checking if argument 1 is not NULL, output the argument 2 if not null, or output argument 3 otherwise

Description

Check if condition is not NULL, if so output outputIfNotNull, otherwise, output outputIfNull.

Usage

ifNotNull(condition, outputIfNotNull, outputIfNull = NULL)

Arguments

condition

argument 1

outputIfNotNull

argument 2

outputIfNull

argument 3

Value

outputIfNotNull if condition is not NULL, outputIfNull otherwise.

Examples

Run this code
# NOT RUN {
ifNotNull(NULL, "x")
ifNotNull(NULL, "x", "y")
ifNotNull(1 < 2, "x", "y")

# }

Run the code above in your browser using DataLab