>m<-matrix(nrow=3,ncol=2,c(1,2,3,4,5,6)) >m [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 > m <- matrix(1:6, nrow = 2, ncol = 3) > m<-matrix(c(1,2,3,4)) m<-matrix(c(1,2,3,4),7,8) m<- matrix(1:9,nrow=3,ncol=3,byrow=TRUE) matrix(1,nrow=10,ncol=10) A <- matrix(0,3,4) z <- A[2,3] # returns 2 nd row and 3 rd col of matrix A and assigns to z > A[2:4,4:2] # Selecting 2 nd ,3 rd and 4 th rows and 4 th ,3 rd and 2 nd colmns and getting another sub matrix. > A[2,2:3] # Second row, 2 nd col and 3 rd col elements. >second.column <- A[,2] #returns second.column; >which(A>8) # returns elements which are greater than 8.