Test if a value is missing, empty, or contains only NA or NULL values
Test if a value is missing, empty, or contains only NA or NULL values.
invalid(x)
x |
value to be tested |
Logical value.
Gregory R. Warnes greg@warnes.net
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.