removecolsAllNA: removecolsAllNA

Description Usage Arguments Value Examples

View source: R/removecolsAllNA.R

Description

This function removes "empty" data frame columns where all the values are NA. It is a wrapper for this excellent StackOverflow answer http://stackoverflow.com/a/15968937/718150

Usage

1

Arguments

mydf

- data frame

Value

data frame

Examples

1
2
3
4
5
6
Cat <- c("CatA", "CatB", "CatC")
Val1 <- c(4, 6, 5)
Val2 <- c(NA, NA, NA)
Val3 <- c(7, NA, 2)
thedf <- data.frame(Cat, Val1, Val2, Val3)
newdf <- removecolsAllNA(thedf)

smach/rmiscutils documentation built on Dec. 15, 2021, 1:49 a.m.