Tuesday, October 26, 2010

R aggregation

> x
  j word journ
1 1    p     b
2 2    g     b
3 3    p     d
4 4    p     b
5 5    p     d
> with(x, tapply(word, journ, length))
b d
3 2

No comments: