isTruthy: Truthy and falsy values

Description Usage Arguments Details

View source: R/utils.R

Description

The terms "truthy" and "falsy" generally indicate whether a value, when coerced to a base::logical(), is TRUE or FALSE. We use the term a little loosely here; our usage tries to match the intuitive notions of "Is this value missing or available?", or "Has the user provided an answer?", or in the case of action buttons, "Has the button been clicked?".

Usage

1

Arguments

x

An expression whose truthiness value we want to determine

Details

For example, a textInput that has not been filled out by the user has a value of "", so that is considered a falsy value.

To be precise, a value is truthy unless it is one of:

Note in particular that the value 0 is considered truthy, even though as.logical(0) is FALSE.


shiny documentation built on Oct. 2, 2021, 9:06 a.m.