remove_na: Remove individuals or variables having too many missing...

View source: R/remove_na.R

remove_naR Documentation

Remove individuals or variables having too many missing values in a dataframe.

Description

Return a new dataframe keeping only the variables with enough information. The user may define a threshold for what is “enough information” (either by a raw number or a proportion).

Usage

remove_na(data, which = c("ind", "var"), prop_min = NULL, n_min = NULL)

Arguments

data

a dataframe.

which

either ind or var, to remove individuals or variables respectively.

prop_min

a proportion between 0 and 1. An individual or a variable must have at least a proportion prop_min of nonmissing values to be kept.

n_min

an integer. An individual or a variable must have at least n_min nonmissing values to be kept.

Value

A dataframe purged from the cases or variables having too many missing values.

Note

If both n_min and prop_min are supplied, only n_min will be used.

Author(s)

Frédéric Santos, frederic.santos@u-bordeaux.fr


frederic-santos/rdss documentation built on March 25, 2023, 5:25 p.m.