I'm trying to change the order in which legend items appear. I've spent about an hour at this, with no results.
Here's an example setup:
library(ggplot2)
set.seed(0)
d <- data.frame(x = runif(3), y = runif(3), a = c('1', '3', '10'))
And here's one of the many things I've tried:
ggplot(d, aes(x = x, y = y)) +
geom_point(size=7, aes(color = a, order = as.numeric(a)))
(My naive hope, of course, was that the legend items would be shown in the numeric order: 1, 3, 10.)