Row of Matrix as a Vector

i have 3 rows in a matrix. I gotta subtract row 1 from row 2 and 3 and return the difference in a vector. how do I do this?

thanks a lot community!

(mymat <- matrix(c(1,3,5,2,4,6),nrow=3))

(myvec <- mymat[2,] + mymat[3,] - mymat[1,])

thank you man, appreciate it.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.