[R] histograms

Nair, Murlidharan T mnair at iusb.edu
Fri Sep 1 23:15:41 CEST 2006


Thanks ../Murli


-----Original Message-----
From: hadley wickham [mailto:h.wickham at gmail.com] 
Sent: Friday, September 01, 2006 5:08 PM
To: Gabor Grothendieck
Cc: Nair, Murlidharan T; r-help at stat.math.ethz.ch
Subject: Re: Re: [R] histograms

> Your data seems to have come through messed up but lets
> assume you have a data frame with one column per tumor.
> The convert your data to stacked form and call histogram:
>
> DF <- data.frame(T1 = 1:10, T2 = 6:15)
>
> library(lattice)
> histogram(~ values | ind, stack(DF))

Or with ggplot and reshape:

install.packages(ggplot)
library(ggplot)
qplot(x=value, facets=. ~ variable, data=melt(DF,m=1:2),
type="histogram")

Hadley



More information about the R-help mailing list