isTruthy: Truthy and falsy values FROM SHINY!...

View source: R/common.R

isTruthyR Documentation

Truthy and falsy values FROM SHINY! https://github.com/rstudio/shiny 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?".

Description

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

Usage

isTruthy(x)

Arguments

x

An expression whose truthiness value we want to determine

Details

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

* 'FALSE' * 'NULL' * '""' * An empty atomic vector * An atomic vector that contains only missing values * A logical vector that contains all 'FALSE' or missing values * An object of class '"try-error"' * A value that represents an unclicked [actionButton()]

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


fpirotti/rRINEX documentation built on Sept. 1, 2022, 9:34 p.m.