Re: [R] histograms

From: hadley wickham <h.wickham_at_gmail.com>
Date: Fri 01 Sep 2006 - 21:07:50 GMT

> 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



R-help@stat.math.ethz.ch 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 Sat Sep 02 07:21:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:17 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.