%||%
R/utils.R
ifnotlen0.Rd
%||% (if length-0) alternative operator
a %||% b
(ANY) element to select only if it is not of length 0.
ANY
(ANY) element to select if a has length 0.
a
a if it is not of length 0, otherwise b.
b
6 %||% 10 #> [1] 6 character() %||% "hi" #> [1] "hi" NULL %||% "hi" #> [1] "hi"