1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R, R/methods_row.R
\name{colAnyNAs,xgCMatrix-method}
\alias{colAnyNAs,xgCMatrix-method}
\alias{rowAnyNAs,xgCMatrix-method}
\title{Check if any elements in a row (column) of a matrix-like object is missing}
\usage{
\S4method{colAnyNAs}{xgCMatrix}(x, rows = NULL, cols = NULL)
\S4method{rowAnyNAs}{xgCMatrix}(x, rows = NULL, cols = NULL)
}
\arguments{
\item{x}{An NxK matrix-like object.}
\item{rows}{A \code{\link{vector}} indicating the subset of rows
(and/or columns) to operate over. If \code{\link{NULL}}, no subsetting is
done.}
\item{cols}{A \code{\link{vector}} indicating the subset of rows
(and/or columns) to operate over. If \code{\link{NULL}}, no subsetting is
done.}
}
\value{
Returns a \code{\link{logical}} \code{\link{vector}} of length N (K).
}
\description{
Check if any elements in a row (column) of a matrix-like object is missing.
}
\details{
The S4 methods for \code{x} of type \code{\link{matrix}},
\code{\link{array}}, or \code{\link{numeric}} call
\code{matrixStats::rowAnyNAs}
/ \code{matrixStats::colAnyNAs}.
}
\examples{
mat <- matrix(0, nrow=10, ncol=5)
mat[sample(seq_len(5 *10), 5)] <- NA
sp_mat <- as(mat, "dgCMatrix")
colAnyNAs(sp_mat)
}
\seealso{
\itemize{
\item \code{matrixStats::\link[matrixStats:anyMissing]{rowAnyNAs}()} and
\code{matrixStats::\link[matrixStats:anyMissing]{colAnyNAs}()} which are
used when the input is a \code{matrix} or \code{numeric} vector.
\item For checks if any element is equal to a value, see
\code{\link[MatrixGenerics]{rowAnys}()}.
\item \code{base::\link{is.na}()} and \code{base::\link{any}()}.
}
}
|