[R] ask for help with this R quesiton

song song
2010-01-27T18:13:59Z

> question like this:
>
> I have data tag and phi, when tag are the same, then phi are the same. like
> below, tag have value 1 2 3 4 and phi have value .9 .3 1 0.
>
> my question is, how can I get the result like
> tag=c(1,2,3,4) and corresponding phi=c(.9,.3,1,0)
>
> tag   phi
> 2    .3
> 1    .9
> 2    .3
> 3    1
> 2    .3
> 1    .9
> 3    1
> 4    0
> 1    .9
> 2    .3
>
> tag=c(2,1,2,3,2,1,3,4,1,2)
> phi=c(.3,.9,.3,1,.3,.9,1,0,.9,.3)
>