input_provided {shinyvalidate}R Documentation

Check whether an input value has been provided

Description

This function takes an input value and uses heuristics to guess whether it represents an "empty" input vs. one that the user has provided. This will vary by input type; for example, a shiny::textInput() is "" when empty, while a shiny::numericInput() is NA.

input_provided returns TRUE for all values except:

Usage

input_provided(val)

Arguments

val

Values to test for availability in a Shiny context.

Details

This function is based on shiny::isTruthy() but tweaked here in shinyvalidate to change the treatment of FALSE values: isTruthy(FALSE) returns FALSE, but input_provided(FALSE) returns TRUE. This difference is motivated by shiny::checkboxInput(), where isTruthy() answers the question of "is the input present and checked" while input_provided is just "is the input present".

Value

A logical vector of length 1.


[Package shinyvalidate version 0.1.3 Index]