check-scalar-hasNonzeroRowsAndCols | R Documentation |
Useful for quickly checking to see if we have dropped rows or columns containing all zeros.
hasNonzeroRowsAndCols(x)
x |
Object. |
This is a common check when handling RNA-seq data prior to generating a heatmap or applying a log transformation, for example.
TRUE
on success;
FALSE
on failure, with cause set.
Updated 2021-01-04.
## TRUE ====
x <- matrix(data = seq_len(4L), nrow = 2L)
print(x)
hasNonzeroRowsAndCols(x)
## FALSE ====
x <- matrix(data = rep(c(0L, 1L), times = 2L), nrow = 2L, byrow = FALSE)
print(x)
hasNonzeroRowsAndCols(x)
x <- matrix(data = rep(c(0L, 1L), times = 2L), nrow = 2L, byrow = TRUE)
print(x)
hasNonzeroRowsAndCols(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.