[R] divid the rows of the matrix by the cector
d.rizopoulos at erasmusmc.nl
Thu Mar 11 13:47:53 CET 2010
say 'mat' is your matrix and 'vec' is your vector, then try this:
mat / rep(vec, each = m)
I hope it helps.
On 3/11/2010 1:44 PM, khazaei at ceremade.dauphine.fr wrote:
> 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
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Department of Biostatistics
Erasmus University Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
More information about the R-help