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:

  • NULL

  • ""

  • An empty atomic vector or list

  • An atomic vector that contains only missing (NA) values

  • A character vector that contains only missing and/or "" values

  • An object of class "try-error"

  • A value that represents an unclicked shiny::actionButton()

input_provided(val)

Arguments

val

Values to test for availability in a Shiny context.

Value

A logical vector of length 1.

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".