Skip to contents

impute_value() replaces all missing values by a specific value and impute_median() replaces all missing values by the (weighted) median of the variable.

Usage

impute_value(df, vars, value)

impute_median(df, vars, group = NULL, weighted = FALSE, weight = NULL)

Arguments

df

A dataframe.

vars

A character vector of the variables to replace na with.

value

The value to replace na with.

group

A character vector of the grouping variables.

weighted

A boolean indicating whether to use the weighted median or not.

weight

The weight variable.