Re: [R] Multiplying each row of a big matrix with a vector

2008-01-30 Thread Megh Dal
) +44 (0)207 004 2968 (Direct Fax) Please visit our Web site at www.ssga.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Attiglah, Mama Sent: 30 January 2008 11:32 To: Megh Dal; [EMAIL PROTECTED] Subject: Re: [R] Multiplying each row of a big matrix wit

Re: [R] Multiplying each row of a big matrix with a vector

2008-01-30 Thread Attiglah, Mama
Attiglah, Mama Sent: 30 January 2008 11:32 To: Megh Dal; [EMAIL PROTECTED] Subject: Re: [R] Multiplying each row of a big matrix with a vector Ret= matrix(sample( 1:1000, 500*9), nrow=500, ncol=9) Pos= c( 2593419 ,2130220, 6198197, 1673888, 198 , 1784732 , 2052120 ,-7490228 ,-5275000

Re: [R] Multiplying each row of a big matrix with a vector

2008-01-30 Thread Attiglah, Mama
PROTECTED] On Behalf Of Megh Dal Sent: 30 January 2008 07:20 To: [EMAIL PROTECTED] Subject: [R] Multiplying each row of a big matrix with a vector I have a big matrix 'ret'. I want to multiply each row of it with a 2nd vector 'pos', resulting result, I want to save in a vector n

Re: [R] Multiplying each row of a big matrix with a vector

2008-01-29 Thread Bill.Venables
port <- as.vector(ret %*% port) should do it. Bill Venables -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Megh Dal Sent: Wednesday, 30 January 2008 5:20 PM To: [EMAIL PROTECTED] Subject: [R] Multiplying each row of a big matrix with a vector I h

[R] Multiplying each row of a big matrix with a vector

2008-01-29 Thread Megh Dal
I have a big matrix 'ret'. I want to multiply each row of it with a 2nd vector 'pos', resulting result, I want to save in a vector named 'port'. I wrote following code: > pos [1] 2593419 2130220 6198197 1673888 198 1784732 2052120 -7490228 -5275000 > dim(ret) [1] 500 9