Re: [R] How to extract from a matrix based on indices in a vector?

2009-06-11 Thread Logickle
Thanks, guys. I'll take at a look at these solutions. BTW, my apologies, by A,B,C,D,... I meant "just some real number", not characters "A","B",..., but I wasn't clear about that. If that effects the solution approach please let me know, but I don't think it does. Thanks again, Doug Marc Schwart

[R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread Logickle
Sorry, there may be some lingo for describing the extraction problem I have, but I don't know it. I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s. Matrix M: 1 2 3 4 ... N 1A C D G ... 2B D F H ... Vector v: