fix_missing_alphanumeric_values: Fill missing values in alphanumeric columns

View source: R/fix_missing_alphanumeric_values.R

fix_missing_alphanumeric_valuesR Documentation

Fill missing values in alphanumeric columns

Description

This function imputes missing values in alphanumeric columns of a data frame. If a column is numeric, missing values are imputed with the column mean. Otherwise, missing values are imputed with the column mode (most common value).

Usage

fix_missing_alphanumeric_values(df)

Arguments

df

A data frame with missing values.

Value

A data frame with imputed missing values.

Examples

df <- data.frame(w = c(7, 8, 180, 7), x = c("a", "b", "c", NA),
                 y = c(4, 5, -6, 4), z = c(7, 8, NA, 7))
fix_missing_alphanumeric_values(df)


fixr documentation built on April 4, 2025, 12:30 a.m.