Re: [R] Removing replicated rows

2009-12-30 Thread Farida Mostajabi
It worked perfectly. Thank you! On Wed, Dec 30, 2009 at 12:21 PM, Henrique Dallazuanna wrote: > Try this: > > unique(x)[rep(1:nrow(unique(x)), m),] > > > On Wed, Dec 30, 2009 at 2:35 PM, wrote: > > Dear All, > > > > I have a matrix like X and need to create a new matrix based on the > vector >

Re: [R] Removing replicated rows

2009-12-30 Thread Henrique Dallazuanna
Try this: unique(x)[rep(1:nrow(unique(x)), m),] On Wed, Dec 30, 2009 at 2:35 PM, wrote: > Dear All, > > I have a matrix like X and need to create a new matrix based on the vector > m which gives the number of replicates for each unique row. The resulting > matrix should look like y. > >> x > x