[R] multiplying columns in matrix

2011-11-16 Thread Eli Cohen
Say I have two matrixes: one is 8x28 and other 8x8 I'd like to multiply, for example, first and second column from the 8x8 and plant them in first column of 8x28. Then take first and third of 8x8 and plant into second column of 8x28.etc. Any ideas? Thanks! [[alternative HTML

Re: [R] multiplying columns in matrix

2011-11-16 Thread Bert Gunter
(Assuming I get your meaning) Sounds like a homework exercise ... The perhaps simplest way to do this is directly with a loop and indexing. Did you think about this at all, as this seem fairly obvious to me. As an exercise for the reader, it can also be (very simply) done by vectorizing the