impute_missing_data: Impute missing Values per Features (i.e., Columns)

View source: R/impute_missing_data.R

impute_missing_dataR Documentation

Impute missing Values per Features (i.e., Columns)

Description

Given an input matrix, impute the missing values via three approaches including mean, median or zero.

Usage

impute_missing_data(x, method = c("mean", "median", "zero"))

Arguments

x

A numeric matrix as input.

method

Imputation method for missing values (mean, median or zero).

Details

impute_missing_data

Value

Imputed matrix.

Author(s)

Matineh Rahmatbakhsh matinerb.94@gmail.com

Examples

x <- matrix(1:10, ncol = 2)
x[1:3, 2] <- NA
row.names(x) <- c("A", "B", "C", "D", "E")
colnames(x) <- c("col1", "col2")
impute_missing_data(x, method = "mean")
impute_missing_data(x, method = "median")
impute_missing_data(x, method = "zero")

mrbakhsh/HPiP documentation built on March 28, 2023, 4:35 p.m.