Skip to content
Prev 312376 / 398506 Next

Fast Normalize by Group

Hello,

If yopu want one value per group use tapply(), if you want one value per 
value of x use ave()

tapply(x, group, FUN = function(.x) .x/sum(.x))
ave(x, group, FUN = function(.x) .x/sum(.x))


Hope this helps,

Rui Barradas
Em 29-11-2012 18:55, Noah Silverman escreveu: