Say I have a matrix
1 2 ~ 80
a x x x x
b x x x x
~ x x x x
z x x x x
and I would like to make a smaller matrix out of a, b, and r/ 3, 5, 7, 8. How would I go about restriction the matrix to just
3 5 7 8
a x x x x
b x x x x
r x x x x
I am attempting to restrict a gene matrix in R