Re: [R] ggplot2: deterministic position_jitter & geom_line with position_jitter

From: Hadley Wickham <>
Date: Fri, 25 Jun 2010 12:26:15 -0500

> I'm having the same problem as Stephan (see below), but what I'm trying to
> jitter is not a numeric vector, but a factor. How do I proceed? (Naively
> jittering a factor makes it numeric, no longer factor, so I don't get the
> custom ordering which conveniently comes with using a factor. I'm not sure
> how I would simulate that custom ordering with the jittered vector ... I
> couldn't find anything online about jittering factors, but maybe I just
> wasn't searching cleverly enough.)

You'll probably need to reorder the factor, then jitter it, and then add custom labels with scale_continuous(). I think I see how to resolve this problem in general (two displays of the same jittered data), but it requires basically a complete rewrite of ggplot2, so it's unlikely to appear before ggplot3.


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 25 Jun 2010 - 17:29:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jun 2010 - 17:30:35 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive