set-if-null: Set a default value if an object is null

set-if-nullR Documentation

Set a default value if an object is null

Description

Set a default value if an object is null

Usage

lhs %||% rhs

Arguments

lhs

An object to set if it's null

rhs

The value to provide if x is null

Value

rhs if lhs is null, else lhs

Author(s)

Hadley Wickham

References

https://adv-r.hadley.nz/functions.html#missing-arguments

Examples

## Not run: 
4 %||% 5
NULL %|| 5

## End(Not run)


satijalab/seurat-data documentation built on April 12, 2025, 7:45 p.m.