I understand that this is old, but maybe this function that I created is useful to someone there:
order_axis<-function(data, axis, column) {
Now, with this function, you can interactively draw with ggplot2, for example:
ggplot(order_axis(df, AXIS_X, COLUMN_Y), aes(x = AXIS_X_o, y = COLUMN_Y)) + geom_bar(stat = "identity")
As you can see, the order_axis function creates another data frame with a new column with the same name, but with _o at the end. This new column has levels in ascending order, so ggplot2 is automatically laid in that order.
This is somewhat limited (it only works for symbolic or factorial and numeric combinations of columns and in ascending order), but I still find it very useful for plotting on the go.
eflores89 Oct 08 '15 at 23:00 2015-10-08 23:00
source share