get_standardized_data: Standardize Data

get_standardized_dataR Documentation

Standardize Data

Description

This function standardizes a dataset by converting columns to numeric or factor types and replacing NA values. For continuous variables, NA values are replaced with either a specific numeric value or a computed statistic. For categorical variables, NA values are replaced with the mode of the column.

Usage

get_standardized_data(data, na_replace = stats::na.omit)

Arguments

data

A data frame to be standardized.

na_replace

A function or numeric value used to replace NA values. If a function, it should take a vector and return a replacement value. If a numeric value, it is used directly to replace NA values in continuous columns. The default is stats::na.omit, which omits rows with NA values (used as an indicator here, not the actual replacement value).

Value

A data frame where columns have been converted to numeric or factor types, and NA values have been replaced according to the method specified.


catalytic documentation built on April 4, 2025, 5:51 a.m.