or: Robust 'or' operator working with truthy and falsy values.

Description Usage Arguments Examples

Description

Robust 'or' operator working with truthy and falsy values.

Usage

1
lhs %||% rhs

Arguments

lhs

Left hand side, always evaluated.

rhs

Right hand side, only evaluated if lhs evaluates to FALSY.

Examples

1
2
3
4
5
6
## Message if list is empty
l <- list(1,2,3)
l %||% message("list is empty")

l <- list()
l %||% message("list is empty")

gaborcsardi/falsy documentation built on May 16, 2019, 4:09 p.m.