R/utilities_Matrix.R
is.Matrix.Rd
Arguably, this function should be in the Matrix package, but it is not. We include it here for convenience.
Matrix
is.Matrix(a)
The object to be queried if it is Matrix.
A boolean. TRUE if a is a Matrix, FALSE otherwise.
TRUE
a
FALSE
This function is not vectorized.
is.Matrix() is a wrapper for inherits(a, "Matrix).
is.Matrix()
inherits(a, "Matrix)
is.Matrix(matrix(42)) #> [1] FALSE is.Matrix(Matrix::Matrix(42)) #> [1] TRUE