by(iris, "Species", :(MeanPetalLength = mean(Petal_Length)))
#this works great
by(iris, ["Species","Sepal_Length"] , :(MeanPetalLength = mean(Petal_Length)))
#as does this
#but what about something like this?
by(iris, "Species", :(MeanPetalLength = mean(Petal_Length, StdPetalLength = std(Petal_length))))
Jacob, you can use John's method. Your first try was also pretty close. Just put a semicolon between the two assignments or use quote-end and a multi line expression. I'd show an example, but I'm not at my computer.
A little clarification here. When you say "ordering" a data frame, what does that mean? Finding the permutation that would put the data in order or actually sorting the rows? For the latter, I would use sort! Or sortby!. The sortby! function for vectors takes as its first argument some function that maps each element to a proxy value used for sorting. For data frames, the names of some set of columns naturally corresponds to the function mapping each row to just those column values, which one can then sort by.There is some argument for making sort!(f,v) do what sortby!(f,v) currently does, especially since sort!(v) is equivalent to sortby!(identity,v). Then we need a way to provide a fully custom sort comparison function, but that can always be for with sort!(Sort.Lt((a,b)->xxx),v).