R/is.empty.R
is.empty.matrix.Rd
This function checks if a matrix has zero rows or zero columns.
# S3 method for matrix is.empty(x)
A matrix object
A logical value: TRUE if the matrix is empty, FALSE otherwise
mat1 <- matrix(nrow = 0, ncol = 5) is.empty(mat1) # Returns TRUE #> [1] TRUE mat2 <- matrix(1:6, nrow = 2) is.empty(mat2) # Returns FALSE #> [1] FALSE