[R] ggplot boxplot - how to order categories

Raj Minhas rajminhas at gmail.com
Mon Aug 25 19:17:16 CEST 2008


I am interested in creating a boxplot using ggplot or qplot where I can
specify the order of the categories being plotted on the x-axis. For
example, the following command plots the categories (diamond color) in
alphabetic order (D, E, ..., J):

qplot(color, price/carat, data=diamonds, geom="boxplot")

I want to know how I can modify this command so that the categories are
plotted in a different order (say, J, D, E, I, H, F, G).

Thanks in advance.

-Raj.
-- 
View this message in context: http://www.nabble.com/ggplot-boxplot---how-to-order-categories-tp19147920p19147920.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list