[R] histograms

hadley wickham h.wickham at gmail.com
Fri Sep 1 23:07:50 CEST 2006


> 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