Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 5
    That syntax does work if you store your data in a data.table, instead of a data.frame: require(data.table); my.dt <- data.table(my.data); my.dt[order(age)] This works because the column names are made available inside the [] brackets. Commented Sep 2, 2013 at 19:34
  • 1
    I don't think the downvote is necessary here, but neither do I think this adds much to the question at hand, particularly considering the existing set of answers, some of which already capture the requirement with data.frames to either use with or $. Commented Feb 14, 2014 at 11:16
  • 2
    upvote for do.call this makes short work of sorting a multicolumn data frame. Simply do.call(sort, mydf.obj) and a beautiful cascade sort will be had. Commented May 25, 2016 at 4:28