[R] plotting group means

hadley wickham h.wickham at gmail.com
Tue Sep 9 15:01:49 CEST 2008


On Tue, Sep 9, 2008 at 6:56 AM, ONKELINX, Thierry
<Thierry.ONKELINX at inbo.be> wrote:
> Dear Erich,
>
> Have a look at ggplot2
>
> library(ggplot2)
> dataset <- expand.grid(x = 1:20, y = factor(LETTERS[1:4]), value = 1:10)
> dataset$value <- rnorm(nrow(dataset), sd = 0.5) + as.numeric(dataset$y)

Or with stat_summary:

qplot(x, value, data=dataset, colour=y, group = y) +
stat_summary(geom="line", fun="mean",size=2)


-- 
http://had.co.nz/



More information about the R-help mailing list