PickTruthy: PickTruthy

View source: R/TruthyHelpers.R

PickTruthyR Documentation

PickTruthy

Description

Choose a value if it truthy. If not, choose it's replacement

Usage

PickTruthy(X, Replacement)

Arguments

X

A value of any type

Replacement

The replacement in case X is falsy

Value

X or Replacement

Examples

PickTruthy(1, 2) # 1
PickTruthy("1", 2) # "1"
PickTruthy("", 2) # 2
PickTruthy(NULL, 3) # 3
PickTruthy(NULL, NA) # NA

SigurdJanson/shinyCSVImpoMod documentation built on Jan. 5, 2023, 3:57 a.m.