is.empty(integer(0)) #TRUE
is.empty(0L) #FALSE
is.empty(numeric(0)) #TRUE
is.empty(NA) # FALSE
is.empty(FALSE) # FALSE
is.empty(NULL) # FALSE (with a warning)
a <- which(1:3 == 5)
b <- numeric(0)
is.empty(a)
is.empty(a,"numeric")
is.empty(b)
is.empty(b,"integer")
Run the code above in your browser using DataLab