Skip to contents

Imputes missing values in a data frame. Numeric columns are imputed with the median, and categorical columns with the most frequent category.

Usage

impute_data(df)

Arguments

df

A data frame with missing values.

Value

A data frame with imputed values.

Examples

impute_data(data.frame(a = c(1, NA, 3), b = c("x", "y", NA)))
#>   a b
#> 1 1 x
#> 2 2 y
#> 3 3 x