| zero_col | R Documentation |
More generally, checks that both row/col sums and sums of absolute
values equal a target.
For value = 0, this means all entries are zero.
single_col() is a wrapper with value = 1, often used to check for
dummy columns/rows with exactly one element that is 1.
zero_col(x, rows = FALSE, value = 0)
single_col(..., value = 1)
x |
Numeric matrix. Sparse matrices from the Matrix package are also supported. |
rows |
Logical; if |
value |
Numeric target (default |
... |
Passed to |
Memory usage is reduced by applying abs() checks only to rows/columns
whose total sum is already the target.
Logical vector.
m <- matrix(c(
0, 0, 0, 0,
1, -1, 0, 0,
0, 0, 1, 0
), nrow = 3, byrow = TRUE)
zero_col(m)
zero_col(m, rows = TRUE)
single_col(m)
single_col(m, rows = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.