Re: [R] Add rank column to data frame as in SQL...

2012-06-02 Thread Gabor Grothendieck
On Fri, Jun 1, 2012 at 11:23 AM, Brigid Mooney wrote: > Hopefully this is an easy problem... > > I'm trying to add a partitioned rank column to a data frame where the > rank is calculated separately across a partition by categories, the > way you could easily do in SQL.  I found this solution in t

Re: [R] Add rank column to data frame as in SQL...

2012-06-01 Thread arun
4 PM Subject: Re: [R] Add rank column to data frame as in SQL... Sorry, I meant to put that it didn't work for "GM", not "Toyota".   > DF[DF$Company=="GM",]    Company Person    Salary rank 1   GM  A  7067.905    4 3   GM  C 31627.171    8

Re: [R] Add rank column to data frame as in SQL...

2012-06-01 Thread Brigid Rotigel
> 5 GM E 66200.5087 > 7 GM G 91287.5923 > 10 GM J 33239.467 6 > 13 GM M 47854.5255 > 14 GM N 76631.0672 > 16 GM P 87532.1331 > > > > > - Original Message - > From: Brigid M

Re: [R] Add rank column to data frame as in SQL...

2012-06-01 Thread William Dunlap
4 5 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Brigid Mooney > Sent: Friday, June 01, 2012 5:23 PM > To: r-help@r-project.org > Subject:

Re: [R] Add rank column to data frame as in SQL...

2012-06-01 Thread arun
239.467    6 13  GM  M 47854.525    5 14  GM  N 76631.067    2 16  GM  P 87532.133    1 - Original Message - From: Brigid Mooney To: r-help@r-project.org Cc: Sent: Friday, June 1, 2012 11:23 AM Subject: [R] Add rank column to data frame as in SQL... Hopefully thi

[R] Add rank column to data frame as in SQL...

2012-06-01 Thread Brigid Mooney
Hopefully this is an easy problem... I'm trying to add a partitioned rank column to a data frame where the rank is calculated separately across a partition by categories, the way you could easily do in SQL. I found this solution in the archives that looked like it might work: http://tolstoy.newc