--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
> x=sample(letters, 5, replace=T)
> x
[1] "s" "a" "m" "e" "j"
> y=factor(x, levels=letters)
> y
[1] s a m e j
Levels: a b c d e f g h i j k l m n o p q r s t u v w x y z
> y[, drop=T]
[1] s a m e j
Levels: a e j m s
--Bruce
I don't know what you're plotting but here's an example where y has more
levels than it requires, factor drops those levels
ggplot(df.subset, aes(x, factor(y)) + geom_bar()
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/