Learn R Programming

xplainfi (version 1.0.0)

op-null-default: Default value for NULL

Description

A backport of %||% available in R versions from 4.4.0.

Usage

x %||% y

Arguments

x, y

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

Examples

Run this code
1 %||% 2
NULL %||% 2

Run the code above in your browser using DataLab