A=matrix(c(1:12),nrow=3,ncol=4,byrow=TRUE) print(A) print(A[c(1,2),c(3,4)]) print(A[c(2,3),]) print(A[,c(1,4)]) print(A[-2,]) print(A[-2,-3]) print(A[,c(-3,-4)])
To embed this program on your website, copy the following code and paste it into your website's HTML: