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

From: Hadley Wickham <hadley_at_rice.edu>
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.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive