simple_zero_replacement: Simple Zero Replacement in a Count Matrix

View source: R/3-shared-zero.R

simple_zero_replacementR Documentation

Simple Zero Replacement in a Count Matrix

Description

This function replaces zeros with the next smallest non-zero value in the input count matrix. If the matrix contains no zeros, it produces an informational message indicating that no replacements were made.

Usage

simple_zero_replacement(ct)

Arguments

ct

A data matrix containing numerical values.

Value

A matrix with zero values replaced by the next smallest non-zero value. If no zeros are found, the function returns the original matrix.

Examples

# Sample input count data with zeros
data <- matrix(c(0, 2, 3, 4, 5, 0), nrow = 2, byrow = TRUE)

tpq/propr documentation built on Feb. 3, 2025, 4:23 a.m.