is.Matrix: Is an object a Matrix?

View source: R/utilities_Matrix.R

is.MatrixR Documentation

Is an object a Matrix?

Description

Arguably, this function should be in the Matrix package, but it is not. We include it here for convenience.

Usage

is.Matrix(a)

Arguments

a

The object to be queried if it is Matrix.

Details

This function is not vectorized.

is.Matrix() is a wrapper for ⁠inherits(a, "Matrix)⁠.

Value

A boolean. TRUE if a is a Matrix, FALSE otherwise.

Examples

is.Matrix(matrix(42))
is.Matrix(Matrix::Matrix(42))

matsbyname documentation built on Oct. 19, 2023, 5:11 p.m.