ifnotlen0: %||% (if length-0) alternative operator

ifnotlen0R Documentation

⁠%||%⁠ (if length-0) alternative operator

Description

⁠%||%⁠ (if length-0) alternative operator

Usage

a %||% b

Arguments

a

(ANY)
element to select only if it is not of length 0.

b

(ANY)
element to select if a has length 0.

Value

a if it is not of length 0, otherwise b.

Examples

6 %||% 10

character() %||% "hi"

NULL %||% "hi"


formatters documentation built on June 22, 2024, 9:42 a.m.