[R] GGPLOT2 Different Layers Different X Values

Bleyhl, Jonathan Jonathan_Bleyhl at affymetrix.com
Wed Oct 28 19:02:53 CET 2009


Hello Hadley,

I'm not sure how easily I'd be able to come up with a good example. My data contain thousands of points, and I can't really divulge this data outside my company. But I can tell you that I found a solution (though somewhat hackish). I just created another matrix with each date having a single value. I then added that as a separate histogram scaled to something ridiculously small (like 0.0001). It acts as a sort of place holder for all the other layers. It seems to do that job.

Thanks,
Jon

-----Original Message-----
From: Hadley Wickham [mailto:h.wickham at gmail.com] 
Sent: Wednesday, October 28, 2009 6:59 AM
To: Bleyhl, Jonathan
Cc: r-help at r-project.org
Subject: Re: [R] GGPLOT2 Different Layers Different X Values

Hi John,

Could you please provide a small reproducible example?

Thanks,

Hadley

Sent from my iPhone

On 26/10/2009, at 6:50 PM, Jonathan Bleyhl <Jonathan_Bleyhl at affymetrix.com 
 > wrote:

>
> I'm trying to plot values based on a date and then overlay a  
> histogram also
> by date. The problem is that both data sets don't have exactly the  
> same
> dates. So when I add the histogram, any dates that aren't already  
> there from
> from the scatter plot just get tacked on at the end and are out of  
> order. I
> tried using scale_x_discrete, but to no avail.
>
> Thanks,
> Jon
> -- 
> View this message in context: http://www.nabble.com/GGPLOT2-Different-Layers-Different-X-Values-tp26069893p26069893.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
------------------------------------------------------------

This transmission is intended for the sole use of the individual
and entity to whom it is addressed, and may contain information
that is privileged, confidential and exempt from disclosure under
applicable law. You are hereby notified that any use,
dissemination, distribution or duplication of this transmission by
someone other than the intended addressee or its designated agent
is strictly prohibited. If you have received this transmission in
error, please notify the sender immediately by reply to this
transmission and delete it from your computer.




More information about the R-help mailing list