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
>
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
2 matches
Mail list logo