Re: [R] joining "one-to-many"

2009-02-22 Thread eugen pircalabelu
A not so elegant way of obtaining your result (compared to merge()) would be: > t1$ val3<-rep(t2$val3, table(t1$loc)) > t1$ val4<-rep(t2$val4, table(t1$loc)) Eugen. --- On Tue, 2/17/09, Monica Pisica wrote: > From: Monica Pisica > Subject: Re: [R] joining "one-to

Re: [R] joining "one-to-many"

2009-02-17 Thread Monica Pisica
ee my confusion. Again, thanks for your help, Monica > Date: Tue, 17 Feb 2009 10:09:17 -0500 > Subject: Re: [R] joining "one-to-many" > From: ggrothendi...@gmail.com > To: pisican...@hotmail.com > CC: r-help@r-project.org > > T

Re: [R] joining "one-to-many"

2009-02-17 Thread ONKELINX, Thierry
John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Monica Pisica Verzonden: dinsdag 17 februari 2009 15:33 Aan: R help project Onderwerp: [R] joining "one-to-many" Hello list, I am wondering if a joining "one-to

Re: [R] joining "one-to-many"

2009-02-17 Thread Gabor Grothendieck
Try merge(t1, t2) On Tue, Feb 17, 2009 at 9:33 AM, Monica Pisica wrote: > > Hello list, > > I am wondering if a joining "one-to-many" can be done a little bit easier. I > tried merge function but I was not able to do it, so I end up using for and > if. > > Suppose you have a table with locatio

Re: [R] joining "one-to-many"

2009-02-17 Thread Marc Schwartz
on 02/17/2009 08:33 AM Monica Pisica wrote: > Hello list, > > I am wondering if a joining "one-to-many" can be done a little bit easier. I tried merge function but I was not able to do it, so I end up using for and if. > > Suppose you have a table with locations, each location repeated several t

Re: [R] joining "one-to-many"

2009-02-17 Thread hadley wickham
On Tue, Feb 17, 2009 at 8:33 AM, Monica Pisica wrote: > > Hello list, > > I am wondering if a joining "one-to-many" can be done a little bit easier. I > tried merge function but I was not able to do it, so I end up using for and > if. > > Suppose you have a table with locations, each location re

[R] joining "one-to-many"

2009-02-17 Thread Monica Pisica
Hello list, I am wondering if a joining "one-to-many" can be done a little bit easier. I tried merge function but I was not able to do it, so I end up using for and if. Suppose you have a table with locations, each location repeated several times, and some attributes at that location. The se