Re: [R] index to select rows of a large matrix

2009-05-21 Thread tsunhin wong
Dear all, I found the answer: intersect() - John On Thu, May 21, 2009 at 7:32 PM, tsunhin wong wrote: > Dear Jim, > Thanks for your suggestion. > > I have a follow-up question for fellow R Users that have followed this thread: > > *I used to create two lists by some very flexible criteria to co

Re: [R] index to select rows of a large matrix

2009-05-21 Thread tsunhin wong
Dear Jim, Thanks for your suggestion. I have a follow-up question for fellow R Users that have followed this thread: *I used to create two lists by some very flexible criteria to compare from "iData" and pass the two lists to *ANOTHER FUNCTION* that further decompose the two lists and do some cas

Re: [R] index to select rows of a large matrix

2009-05-21 Thread jim holtman
Assuming that you get the list of indices into iData for the criteria, then you can use that to get the appropriate rows: indx <- which(iData >5) # or whatever your criteria is DataSeq[indx,, drop=FALSE] # gives you a subset matrix of just the rows you are interested in. On Thu, May 21, 2009 at

[R] index to select rows of a large matrix

2009-05-21 Thread tsunhin wong
Dear R Users, I have created a 1500 x 2 data frame - DataSeq. Each of the 1500 rows represents a data sequence. I have another data frame iData that stores the information of these 1500 data sequences in the same order, for example, condition, gender, etc. If I use "subset" to select certain