colAnyNAs-xgCMatrix-method: Check if any elements in a row (column) of a matrix-like...

Description Usage Arguments Details Value See Also Examples

Description

Check if any elements in a row (column) of a matrix-like object is missing.

Usage

1
2
3
4
5
## S4 method for signature 'xgCMatrix'
colAnyNAs(x, rows = NULL, cols = NULL)

## S4 method for signature 'xgCMatrix'
rowAnyNAs(x, rows = NULL, cols = NULL)

Arguments

x

An NxK matrix-like object.

rows

A vector indicating the subset of rows (and/or columns) to operate over. If NULL, no subsetting is done.

cols

A vector indicating the subset of rows (and/or columns) to operate over. If NULL, no subsetting is done.

Details

The S4 methods for x of type matrix, array, or numeric call matrixStats::rowAnyNAs / matrixStats::colAnyNAs.

Value

Returns a logical vector of length N (K).

See Also

Examples

1
2
3
4
  mat <- matrix(0, nrow=10, ncol=5)
  mat[sample(seq_len(5 *10), 5)] <- NA
  sp_mat <- as(mat, "dgCMatrix")
  colAnyNAs(sp_mat)

sparseMatrixStats documentation built on Feb. 4, 2021, 2 a.m.