colAlls {DelayedMatrixStats} | R Documentation |
Checks if a value exists / does not exist in each row (column) of a matrix.
colAlls(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), ...) colAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), ...) rowAlls(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), ...) rowAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), ...) ## S4 method for signature 'DelayedMatrix' colAlls(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), force_block_processing = FALSE, ...) ## S4 method for signature 'DelayedMatrix' colAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), force_block_processing = FALSE, ...) ## S4 method for signature 'DelayedMatrix' rowAlls(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), force_block_processing = FALSE, ...) ## S4 method for signature 'DelayedMatrix' rowAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), force_block_processing = FALSE, ...)
x |
A NxK DelayedMatrix. |
rows |
A |
cols |
A |
value |
A value to search for. |
na.rm |
|
dim. |
An |
... |
Additional arguments passed to specific methods. |
force_block_processing |
|
These functions takes either a matrix or a vector as input. If a vector,
then argument dim.
must be specified and fulfill prod(dim.) ==
length(x)
. The result will be identical to the results obtained when
passing matrix(x, nrow = dim.[1L], ncol = dim.[2L])
, but avoids
having to temporarily create/allocate a matrix, if only such is needed
only for these calculations.
rowAlls()
(colAlls()
) returns an
logical
vector
of length N (K).
Analogously for rowAnys()
(rowAlls()
).
value
When value
is logical, the result is as if the function is applied
on as.logical(x)
. More specifically, if x
is numeric, then
all zeros are treates as FALSE
, non-zero values as TRUE
,
and all missing values as NA
.
When value
is logical, the result is as if the function is applied
on as.logical(x)
. More specifically, if x
is numeric, then
all zeros are treates as FALSE
, non-zero values as TRUE
,
and all missing values as NA
.
rowCounts
# A DelayedMatrix with a 'matrix' seed dm_matrix <- DelayedArray(matrix(c(rep(1L, 5), as.integer((0:4) ^ 2), seq(-5L, -1L, 1L)), ncol = 3)) # A DelayedMatrix with a 'SolidRleArraySeed' seed dm_Rle <- RleArray(Rle(c(rep(1L, 5), as.integer((0:4) ^ 2), seq(-5L, -1L, 1L))), dim = c(5, 3)) colAlls(dm_matrix, value = 1) colAnys(dm_matrix, value = 2) rowAlls(dm_Rle, value = 1) rowAnys(dm_Rle, value = 2)