I have a very large data frame with numerous variables that are completely empty (NAs). My goal is to remove these variables. I want to exclude empty variables, not missing values. This seems like a very basic question but I cannot figure it out.
#sample data
A<-rbinom(100,1,1/2)
B<-rbinom(100,1,1/2)
C<-NA
D<-NA
df<-as.data.frame(cbind((1:100),A,B,C,D))
df<-as.data.frame(lapply(df, function(x)
"is.na<-"(x, sample(seq(x), floor(length(x) * runif(1, 0, .2))))))
Hmisc::describe(df)
I can make a list of these variables using Hmisc::describe(), but I can't figure out how to extract or use this list.