Re: [R] ask for help with this R quesiton

2010-01-27 Thread song song
> > 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

[R] ask for help with this R quesiton

2010-01-27 Thread song song
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 31 2

Re: [R] ask for help with this R quesiton

2010-01-27 Thread Henrique Dallazuanna
Try this: unique(cbind(tag, phi))[order(unique(tag)),] On Wed, Jan 27, 2010 at 4:13 PM, song song wrote: >> 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, h

[R] ask for help with this R quesiton

2010-01-27 Thread song song
> 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