Hi,

I have a matrix:

mymat <- matrix(runif(10*4), ncol=4)

I wish to subtract the column means, down the colums, subtract the row means 
from the rows and add back the grand mean - all the means should be the means 
of mymat rather than of the new matrix. 

How can I do this?

Any help much appreciated.

Thanks

Tom

_________________________________________________________________


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to