Skip to content
Prev 87075 / 398506 Next

Ranking within factor subgroups

Hi Adai,

I think your solution only works if the rows of the data frame are ordered 
by "date" and
the ordering function is the same used to order the levels of 
factor(df$date) ?
It turns out (as I implied in my question) my data is indeed organized in 
this manner, so my
current problem is solved.
In the general case, I suppose, one could always order the data frame by 
date before proceeding ?

Thanks,

Maneesh