Re: [R] two histograms in the same graph

2008-01-25 Thread hadley wickham
On Jan 25, 2008 2:04 PM, Domenico Vistocco <[EMAIL PROTECTED]> wrote: > You could use ggplot2: > > library(ggplot2) > x=rnorm(100) > y=rnorm(100) > df=melt(data.frame(x,y)) > #for "vertical" histogram > ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable) > #for "horizontal" histogr

Re: [R] two histograms in the same graph

2008-01-25 Thread Domenico Vistocco
You could use ggplot2: library(ggplot2) x=rnorm(100) y=rnorm(100) df=melt(data.frame(x,y)) #for "vertical" histogram ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable) #for "horizontal" histogram ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable) + coord_flip

Re: [R] two histograms in the same graph

2008-01-25 Thread David Daniel
You might look at the method histbackback (back-to-back histograms) in package Hmisc. At the time I looked at this package about a year ago, I could not get it working on my Mac, so I don't actually know what the results look like, but I have created them before in XLispStat and found them

Re: [R] two histograms in the same graph

2008-01-25 Thread Jim Lemon
Juan Pablo Fededa wrote: > Dear Contributors: > > I have two vectors x and z, and I want to display the histograms of both > vectors in the same graph, x in red bars, z in blue bars. > If you have any clue on how to do that, I will be very glad to hear it!! > Thanks in advance again, > Hi Jua

Re: [R] two histograms in the same graph

2008-01-24 Thread Peter Dalgaard
Duncan Murdoch wrote: > On 1/24/2008 9:43 AM, Juan Pablo Fededa wrote: > >> Dear Contributors: >> >> I have two vectors x and z, and I want to display the histograms of both >> vectors in the same graph, x in red bars, z in blue bars. >> If you have any clue on how to do that, I will be very gla

Re: [R] two histograms in the same graph

2008-01-24 Thread Duncan Murdoch
On 1/24/2008 9:43 AM, Juan Pablo Fededa wrote: > Dear Contributors: > > I have two vectors x and z, and I want to display the histograms of both > vectors in the same graph, x in red bars, z in blue bars. > If you have any clue on how to do that, I will be very glad to hear it!! It's hard to

Re: [R] two histograms in the same graph

2008-01-24 Thread ONKELINX, Thierry
delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Juan Pablo Fededa Verzonden: donderdag 24 januari 2008 15:44 Aan: r-help Onderwerp: [R] two histograms in the same graph Dear Contributor

[R] two histograms in the same graph

2008-01-24 Thread Juan Pablo Fededa
Dear Contributors: I have two vectors x and z, and I want to display the histograms of both vectors in the same graph, x in red bars, z in blue bars. If you have any clue on how to do that, I will be very glad to hear it!! Thanks in advance again, Juan Pablo Fededa [[alternative HTML