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 Nov. 11, 2024, 9:33 a.m.