remove_na: Removes observations with NAs

Description Usage Arguments Value Examples

View source: R/remove_na.R

Description

remove_na() is a function that removes observations that have an NA in any specified column

Usage

1
remove_na(DT, cols, track = T)

Arguments

DT

a data.table

cols

columns to look for NA observations

track

logical, if TRUE prints the number of observations dropped because of each variable

Value

The data.table without NAs in any of the specified columns

Examples

1
2
3
# 2013 nyc flights data
DT <- as.data.table(nycflights13::flights)
DT_clean <- remove_na(DT = DT, cols = c("arr_delay", "carrier"))

appmicro/appmicro documentation built on Nov. 2, 2019, 1:58 p.m.