[R] Histogram for each ID value

Ben Bolker bbolker at gmail.com
Mon Oct 17 15:58:27 CEST 2011


Paul Hiemstra <paul.hiemstra <at> knmi.nl> writes:

> 
> Hi,
> 
> When using ggplot, take a look at facet_wrap and geom_histogram.
> 
> regards,

  More specifically, try something along the lines of

d <- data.frame(f=factor(paste("chr",rep(c(1,2,3,7,9,22),each=50),sep="")),
     v=runif(300))
library(ggplot2)
ggplot(d,aes(x=v))+geom_histogram()+facet_wrap(~f)



More information about the R-help mailing list