IsMatrixEmpty: Check to see if a matrix is empty

View source: R/zzz.R

IsMatrixEmptyR Documentation

Check to see if a matrix is empty

Description

Deterime if a matrix is empty or not

Usage

IsMatrixEmpty(x)

Arguments

x

A matrix

Details

A matrix is considered empty if it satisfies one of the following conditions:

  • The dimensions of the matrix are 0-by-0 (all(dim(x) == 0))

  • The dimensions of the matrix are 1-by-1 (all(dim(x) == 1)) and the sole value is a NA

These two situations correspond to matrices generated with either new('matrix') or matrix()

Value

TRUE if the matrix is empty otherwise FALSE

Examples

## Not run: 
IsMatrixEmpty(new('matrix'))
IsMatrixEmpty(matrix())
IsMatrixEmpty(matrix(1:9, nrow = 3))

## End(Not run)


satijalab/seurat-data documentation built on April 12, 2025, 7:45 p.m.