[R] paired samples, matching rows, merge()

Gabor Grothendieck ggrothendieck at gmail.com
Fri Aug 20 15:33:09 CEST 2010


On Fri, Aug 20, 2010 at 9:27 AM, Cecilia Carmo <cecilia.carmo at ua.pt> wrote:
> It wasn't the merge command. It doesn't create the variable x3.
>
> Cecília
>
>

How about:

x$k3 <- with(x, unlist(tapply(k1, k1, seq_along)))
y$k3 <- with(y, unlist(tapply(k1, k1, seq_along)))



More information about the R-help mailing list