I am writing a function, which needs a check on whether (and which!) column (variable) has all missing values (NA, ). The following is fr
NA
To test whether columns have all missing values:
apply(test1,2,function(x) {all(is.na(x))})
To get which columns have all missing values:
test1.nona <- test1[ , colSums(is.na(test1)) == 0]