Remove NAs according to a strategy

Description

Remove NAs according to a strategy

Usage

1
drop_na(strategy = c("dependent", "predictors", "all", "none"), df, dependent)

Arguments

strategy

Character string denoting how NAs should be dealt with. "dependent" means rows with NA in the dependent variable are dropped. "predictors" means rows with NA in an independent variable are dropped. "all" means rows with NA in any column are dropped. "none" means NAs are ignored.

df

Data frame to remove NAs from

dependent

Dependent variable of the data frame

Value

A data.frame where strategy has been applied to remove data

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.