imputeBetasMatrixByMean: Impute Missing Values with Mean This function replaces...

View source: R/impute.R

imputeBetasMatrixByMeanR Documentation

Impute Missing Values with Mean This function replaces missing values (NA) in a matrix, default is row means.

Description

Impute Missing Values with Mean This function replaces missing values (NA) in a matrix, default is row means.

Usage

imputeBetasMatrixByMean(mx, axis = 1)

Arguments

mx

A matrix

axis

A single integer. Use 1 to impute column means (default), and 2 to impute row means.

Value

A matrix with missing values imputed.

Examples

mx <- cbind(c(1, 2, NA, 4), c(NA, 2, 3, 4))
imputeBetasMatrixByMean(mx, axis = 1)
imputeBetasMatrixByMean(mx, axis = 2)

zwdzwd/sesame documentation built on Dec. 21, 2024, 1:20 p.m.