Guest User

Untitled

a guest
Oct 20th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. > m<-matrix(c(1,4,6,7,0,0,1,1,0,0,3,2),3,4, byrow=TRUE)
  2. > m
  3. [,1] [,2] [,3] [,4]
  4. [1,] 1 4 6 7
  5. [2,] 0 0 1 1
  6. [3,] 0 0 3 2
  7.  
  8. > m[1,c(1,2)]
  9.  
  10. [1] 1 4
  11.  
  12. > m[1,c(3,4)]
  13.  
  14. [1] 6 7
  15.  
  16. > m[c(2,3),c(1,2)]
  17.  
  18. [,1] [,2]
  19. [1,] 0 0
  20. [2,] 0 0
  21.  
  22. > m[c(2,3),c(3,4)]
  23.  
  24. [,1] [,2]
  25. [1,] 1 1
  26. [2,] 3 2
Add Comment
Please, Sign In to add comment