If I create an aggregation like this:

aggregate(lastYear[,8:10],list(Stadium=lastYear$STAD),mean)

I'll get a new data frame, which I can order if I assign it like this:

newFrame <- aggregate(lastYear[,8:10],list(Stadium=lastYear$STAD),mean)
newFrame[order(newFrame$TEMP),]

But.. if I just want to do this in one statement, what can I do?  If this
was perl, I'd be using something like $_:

aggregate(lastYear[,8:10],list(Stadium=lastYear$STAD),mean)[order($_$TEMP),]

So basically, I want to call order within the square braces, and I want to
reference the dataframe that preceeds the square brace.  Is there a way to
do this in R?

thanks,
bp

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to