getzerorowcolnames_byname: Names of zero rows and columns

View source: R/Utilities.R

getzerorowcolnames_bynameR Documentation

Names of zero rows and columns

Description

When a matrix has rows or columns full of zeroes, it is singular, and can't be inverted. This function returns the names of rows or columns that are full with zeroes.

Usage

getzerorowcolnames_byname(a, tol = 1e-06)

Arguments

a

A matrix or list of matrices.

tol

The allowable deviation from 0 for any element.

Value

A vector of names of zero rows or columns.

Examples

m <- matrix(c(1, 0, 1,
              1, 0, 0, 
              0, 0, 0),
            dimnames = list(c("r1", "r2", "r3"), c("c1", "c2", "c3")), 
            nrow = 3, ncol = 3, byrow = TRUE)
m
getzerorowcolnames_byname(m)

matsbyname documentation built on Oct. 19, 2023, 5:11 p.m.