Learn R Programming

healthcareai (version 1.2.4)

removeColsWithOnlyNA: Remove columns from a data frame that are only NA

Description

Remove columns from a data frame when all of their rows are NA's

Usage

removeColsWithOnlyNA(df)

Arguments

df

A data frame

Value

A data frame with columns of only NA's removed

References

http://healthcare.ai

See Also

healthcareai

Examples

Run this code
# 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