Description Usage Arguments Value Examples
View source: R/removecolsAllNA.R
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
1 | removecolsAllNA(mydf)
|
mydf |
- data frame |
data frame
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.