invalid: Test if a value is missing, empty, or contains only NA or NULL values

Description

Test if a value is missing, empty, or contains only NA or NULL values.

Usage

1

Arguments

x

value to be tested

Value

Logical value.

Author(s)

Gregory R. Warnes greg@warnes.net

See Also

missing, is.na, is.null

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
invalid(NA)
invalid()
invalid(c(NA,NA,NULL,NA))

invalid(list(a=1,b=NULL))

# example use in a function
myplot <- function(x,y) {
                if(invalid(y)) {
                        y <- x
                        x <- 1:length(y)
                }
                plot(x,y)
        }
myplot(1:10)
myplot(1:10,NA)

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.