[R] how to create a variable to rank within subgroups
Gabor Grothendieck
ggrothendieck at gmail.com
Tue Jun 7 14:08:54 CEST 2005
On 07 Jun 2005 12:18:06 +0200, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote:
> Denis Chabot <chabotd at globetrotter.net> writes:
>
> > Thank you very much Andy, this is exactly what I was looking for. I
> > did not know this function.
>
> It's a horrible misnomer though (ave() is originally for replacing values
> with averages, but obviously has other uses). Any suggestions for a
> better name (or alias).
ave seems to be a generalized projection as ave(y,x,mean)
equals fitted(lm(y~x)) and for suitable functions f ave(y,x,f) is
idempotent. Not sure if that suggests a name.
More information about the R-help
mailing list