[R] On matrix calculation

Christofer Bogaso bogaso.christofer at gmail.com
Wed Apr 17 14:39:59 CEST 2013


Hello again,

Let say I have a matrix:

Mat <- matrix(1:12, 4, 3)

And a vector:

Vec <- 5:8

Now I want to do following:

Each element of row-i in 'Mat' will be divided by i-th element of Vec

Is there any direct way to doing that?

Thanks for your help



More information about the R-help mailing list