Learn R Programming

matsbyname (version 0.6.11)

is.Matrix: 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)

Value

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

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).

Examples

Run this code
is.Matrix(matrix(42))
is.Matrix(Matrix::Matrix(42))

Run the code above in your browser using DataLab