is.matrix() function in R Language is used to return TRUE if the specified data is in the form of matrix else return FALSE.
Syntax: is.matrix(x)
Parameters:
x: specified matrix
Example 1:
# R program to illustrate # is.matrix function # Specifying some different types of arrays A <- matrix(c(1:5)) B <- matrix(c(1:12), nrow = 4, byrow = TRUE) C <- matrix(c(1:12), nrow = 4, byrow = FALSE) # Calling is.matrix() function is.matrix(A) is.matrix(B) is.matrix(C) |
chevron_right
filter_none
Output:
[1] TRUE [1] TRUE [1] TRUE
Example 2:
# R program to illustrate # is.matrix function # Specifying Biochemical oxygen demand data x <- BOD # Calling is.matrix() function is.matrix(x) # Calling is.matrix() function # over different types of data is.matrix(4) is.matrix("2") is.matrix("a") |
chevron_right
filter_none
Output:
[1] FALSE [1] FALSE [1] FALSE [1] FALSE
Recommended Posts:
- Convert an Object into a Matrix in R Programming - as.matrix() Function
- Check if Object is of the Character Data type in R Programming - is.character() Function
- Check if the Object is a Data Frame in R Programming - is.data.frame() Function
- Check if the Object is a List in R Programming - is.list() Function
- Check if an Object of the Specified Name is Defined or not in R Programming - exists() Function
- Check if an Object is of Type Character in R Programming - is.character() Function
- Check if an Object is of Type Integer in R Programming - is.integer() Function
- Check if an Object is of Type Numeric in R Programming - is.numeric() Function
- Check if an Object is of Complex Data Type in R Programming - is.complex() Function
- Check for the Existence of a Vector Object in R Programming - is.vector() Function
- Check if an Object is a Call in R Programming - is.call() Function
- Check if an Object is a Table in R Programming - is.table() Function
- Check if an Object is an Expression in R Programming - is.expression() Function
- Check if an Object is sorted or not in R Programming - is.unsorted() Function
- Convert a Data Frame into a Numeric Matrix in R Programming - data.matrix() Function
- Applying a Function over an Object in R Programming - sapply() Function
- Transform the Scaled Matrix to its Original Form in R Programming - Using Matrix Computations
- Check if a Matrix is Symmetric or not in R Programming - isSymmetric() Function
- Print the Value of an Object in R Programming - identity() Function
- Convert type of data object in R Programming - type.convert() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

