How about this approach, using aggregate():
> DF
StandID PlotNum HerbNum Woody
1 001 1 1low
2 001 2 2 medium
3 001 3 1low
4 001 4 3low
5 001 5 1 high
6 001 6 2 medium
7 002
Tena koe Randy
If your dataframe is called randy, then the following seems to work:
aggregate(randy[,-(1:2)], list(randy[,1]), function(x) {tt <- table(x);
names(tt)[which.max(tt)]})
HTH
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun.
Do you expect this to be easy? It may be, but I can't see a particularly
graceful way to do it. Here is one possible solution.
> dat
StandID PlotNum HerbNum Woody
1 001 1 1low
2 001 2 2 medium
3 001 3 1low
4 001 4 3
3 matches
Mail list logo