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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/invalid.R

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 [email protected]

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)

gtools documentation built on May 30, 2017, 1:58 a.m.

Related to invalid in gtools...