Best Answer · By JanBask Data Science Expert
Answered on Nov 10, 2019
[ 7, 8]
[12,13]
Let us create a matrix of 5 by 5 consisting of numbers 1-25.
mat2 <- matrix(1:25,byrow = TRUE,nrow = 5)
mat2

Now to grab a subset of mat2, we can do the following.
mat2[2:3,2:3]
Output:
7 8
12 13