mat_miss: Column or Row Missing Counts and Proportions

View source: R/mat_miss.R

mat_missR Documentation

Column or Row Missing Counts and Proportions

Description

Calculate the number or proportion of missing values per column or per row of a numeric matrix without allocating a full logical mask matrix.

Usage

mat_miss(obj, col = TRUE, prop = FALSE)

Arguments

obj

A numeric matrix.

col

Logical. If TRUE, compute column-wise. If FALSE, compute row-wise.

prop

Logical. If FALSE, return missing-value counts. If TRUE, return missing-value proportions.

Value

A numeric vector containing missing-value counts or proportions for columns or rows, named when the corresponding dimension names are present.

Examples

obj <- matrix(c(1, NA, 3, 4, NA, 6, NA, 8, 9), nrow = 3)
obj

# column missing counts
mat_miss(obj)

# row missing counts
mat_miss(obj, col = FALSE)

# column missing proportions
mat_miss(obj, prop = TRUE)


slideimp documentation built on June 17, 2026, 1:08 a.m.