impute_missing_data {HPiP} | R 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")

[Package HPiP version 1.0.0 Index]