Re: [R] Alphabetical sequence of data along the x-axis in a box plot

2011-10-13 Thread Dan_K
The easiest work-around I've found for this problem is to create a vector in your data frame just using numbers to order them how you want, create a separate "labeling" data frame with those numbers and corresponding text labels, and then enter the vector with the grouping names from the labeling f

Re: [R] Alphabetical sequence of data along the x-axis in a box plot

2010-09-27 Thread Peter Alspach
Tena koe Eddie One way: eddie <- data.frame(grp=rep(c('small','medium','large','very large'), each=20), wgt=rnorm(80, 100, 10)) with(eddie, plot(grp, wgt)) eddie$grp <- factor(eddie$grp, levels=c('small','medium','large','very large')) with(eddie, plot(grp, wgt)) HTH ... Peter Alspach > -

Re: [R] Alphabetical sequence of data along the x-axis in a box plot

2010-09-27 Thread Joshua Wiley
Hi Eddie, I've been on a role with the iris data, so I figure why stop. Assuming that one variable is a factor, you can easily reverse it, and if you want fine tuned control, then just reorder the levels. Here is an example: dat <- iris boxplot(Sepal.Length ~ Species, data = dat) boxplot(Sepal.L