
 
m1 <- matrix(rnorm(40), ncol=4)
m2 <- matrix(rnorm(40), ncol=4)
 
I would like to subtract first column of m1 from all columns of m2, subtract 2nd of m1 from all columns of m2, and so on. Obviously, I am not using the appropriate function outer(m1, m1, "-"), since the first column isn't all 0s. 
 
_________________________________________________________________


	[[alternative HTML version deleted]]

