Learn R Programming

tidytidbits (version 0.3.3)

invalid: A notion of valid and invalid

Description

An object is valid if it is not null, not missing (NA), and is not an empty vector. Note that this is per se not vectorised, because a non-empty list or vector is valid as such.

Usage

invalid(x)

valid(x)

Value

logical

Arguments

x

Any object, value or NULL

Functions

  • valid(): x is not invalid

Examples

Run this code
invalid(NULL) # TRUE
invalid(NA) # TRUE
invalid(list()) # TRUE
invalid("a") # FALSE
invalid(c(1,2,3)) # FALSE

Run the code above in your browser using DataLab