dropAllNA: dropAllNA

Description Usage Arguments Value Examples

Description

dropAllNA will drop all columns, rows, or both, where all entries in the data.frame are NA

Usage

1
dropAllNA(data, axis = c("all", "col", "row"))

Arguments

data

data.frame containing data

axis

which axis to remove from: 'row' removes all rows where all columns have missing data. 'col' removes all columns where all rows are NA. 'all' does both.

Value

data frame with the rows/columns missing

Examples

1
2
3
4
5
6
7
8
#df <- data.frame(a = c(1, 2, NA, 4),
#                 b = c(5, 6, NA, 7),
#                 c = c(NA, NA, NA, NA),
#                 d = c(8, 9, NA, 10))
#dropAllNA(df) #default is 'all'
#dropAllNA(df, 'all') #remove rows and cols with missing
#dropAllNA(df, 'col') #remove cols with missing
#dropAllNA(df, 'row') #remove rows with missing

TaylorAndrew/atClean documentation built on May 9, 2019, 4:21 p.m.