is.matrix() Function: Check If an Object is a Matrix in R
The is.matrix() is a built-in R function that checks whether an input object is a matrix. It returns TRUE if the object is a matrix and FALSE otherwise. To prevent unexpected errors, you need to check if the input object is a matrix, and that’s where we need this function. It makes our code more … Read more