Ifnone: Default for NULL and NA value

IfnoneR Documentation

Default for NULL and NA value

Description

set default value for object, including NULL and NA and length 0.

Usage

x %|||% y

Arguments

x

character/numeric/factor/list. An object which could be checked by is.na().

y

ANY. A default value

Value

%|||%: x unless NULL, NA nor length(x) == 0, otherwise y

Examples

1    %|||% 1
NA   %|||% 1
NULL %|||% 1


TrustVDJ documentation built on March 18, 2022, 5:53 p.m.