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!
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.