How can I add an extra column containing the rank to a ragged array indexed by more than one grouping factors?
E.g. with the barley dataset: How can I to add an additional column ``rank'' containing the rank of the ``yield'' of the different varieties in relation to the indices ``year'' and ``site'' to the barley dataframe? I achieved to calculate the ranks with: rank.lists <- with( barley, tapply( yield, list( site=site, year=year ), rank ) ) but I do not manage to merge this result to the original dataframe ``barley''. Thanks! Wolfram ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html