powered by
Remove columns from a data frame when all of their rows are NA's
removeColsWithOnlyNA(df)
A data frame
A data frame with columns of only NA's removed
http://healthcare.ai
healthcareai
# NOT RUN { df <- data.frame(a=c(1,1,1), b=c('a','b','b'), c=c('a','NA','a'), d=c(NA,NA,NA)) dfResult <- removeColsWithOnlyNA(df) head(dfResult) # }
Run the code above in your browser using DataLab