powered by
Often, it helps to know whether an object is a matrix or a Matrix, and you don't care which. This function helps in those situations.
matrix
Matrix
is_matrix_or_Matrix(a)
TRUE when a is a matrix or a Matrix. FALSE otherwise.
TRUE
a
FALSE
The object about which we want to know if it is a matrix or a Matrix.
is_matrix_or_Matrix(42) is_matrix_or_Matrix(matrix(42)) is_matrix_or_Matrix(Matrix::Matrix(42)) is_matrix_or_Matrix(matsbyname::Matrix(42))
Run the code above in your browser using DataLab