Description Usage Arguments Details Value Examples
If the LHS eveluates to NULL, a zero-length vector, or
an empty string, return the RHS, otherwise return the LHS.
1 2 3 4 5 6 7 8 9 | a %||% b
a %|% b
a %|na|% b
a %|NA|% b
a %|null|% b
|
a |
Some value. |
b |
Some default value. |
%|% is a vectorized version of %||%
%|na|% returns the RHS if the LHS evaluates to NA
%|NA|% is a vectorized version of %|na|%
%|null|% explicitly works only on NULL but
not empty strings and vectors.
a, if a is not NULL, not an empty
vector, not an empty string, or not NA.
1 2 3 4 5 | a1 <- "some value"
a2 <- ""
b <- "default value"
a1 %||% b
a2 %||% b
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.