If the function call is.matrix(X) returns true then X can be considered as a matrix data object otheriwse not.