Learn R Programming

ospsuite.utils (version 1.2.0)

op-null-default: Default value for NULL

Description

Convenience function to avoid testing for NULL.

Usage

x %||% y

Arguments

x, y

If x is NULL, will return y; otherwise returns x.

Value

The first object if it is not NULL otherwise the second object.

Examples

Run this code
# NOT RUN {
1 %||% 2
NULL %||% 2

# }

Run the code above in your browser using DataLab