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
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
Hi Monica,
merge(t1, t2) works on your example. So why don't you use merge?
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodolo
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
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
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
6 matches
Mail list logo