Skip to contents

This function imputes missing values in a matrix with column means and reports the count of missing values per column.

Usage

impute_and_report_na(mat)

Arguments

mat

A numeric matrix.

Value

A matrix with imputed values.

Examples

mat <- matrix(c(1, NA, 3, 4, 5, NA), ncol = 2)
impute_and_report_na(mat)
#> No missing values detected.
#>      [,1] [,2]
#> [1,]    1    4
#> [2,]   NA    5
#> [3,]    3   NA