Skip to content
Prev 87076 / 398506 Next

Ranking within factor subgroups

"maneesh deshpande" <dmaneesh at hotmail.com> writes:
You might prefer to look at split/unsplit/split<-, i.e. the z-scores
by group line:

     z <- unsplit(lapply(split(x, g), scale), g)

with "scale" suitably replaced. Presumably (meaning: I didn't quite
read your code closely enough)

    z <- unsplit(lapply(split(x, g), bucket, 10), g)

could do it.