colAnyNAs,xgCMatrix-method | R Documentation |
Check if any elements in a row (column) of a matrix-like object is missing.
## S4 method for signature 'xgCMatrix'
colAnyNAs(x, rows = NULL, cols = NULL, useNames = TRUE)
## S4 method for signature 'xgCMatrix'
rowAnyNAs(x, rows = NULL, cols = NULL, useNames = TRUE)
x |
An NxK matrix-like object. |
rows , cols |
A |
useNames |
If |
The S4 methods for x
of type matrix
,
array
, table
, or numeric
call
matrixStats::rowAnyNAs
/
matrixStats::colAnyNAs
.
Returns a logical
vector
of length N (K).
matrixStats::rowAnyNAs()
and
matrixStats::colAnyNAs()
which are
used when the input is a matrix
or numeric
vector.
For checks if any element is equal to a value, see
rowAnys()
.
base::is.na()
and base::any()
.
mat <- matrix(0, nrow=10, ncol=5)
mat[sample(seq_len(5 *10), 5)] <- NA
sp_mat <- as(mat, "dgCMatrix")
colAnyNAs(sp_mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.