say 'mat' is your matrix and 'vec' is your vector, then try this:
mat / rep(vec, each = m) I hope it helps. Best, Dimitris On 3/11/2010 1:44 PM, [email protected] wrote:
Hi, I have a matrix with m rows and n column and a vector with n elements. I want to divid each rows of the matrix by vector direcly. could you please hint me? Thank you khazaei ______________________________________________ [email protected] 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.
-- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus University Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014 ______________________________________________ [email protected] 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.

