It's a boxplot - http://en.wikipedia.org/wiki/Box_plot
If you want to do something else, it's not a boxplot, and you might
try looking at stat_summary.
Hadley
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> To post to this group, send email to ggp...@googlegroups.com
> To unsubscribe from this group, send email to
> ggplot2+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ggplot2
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
As for the first question, they are documented in a web site:
http://had.co.nz/ggplot2/stat_boxplot.html
As for the second question, you can combine stat_summary and geom_boxplot:
fun<-function(y){
try_require("Hmisc")
ci<-smean.cl.boot(y)
data.frame(lower=ci["Lower"],upper=ci["Upper"],ymin=min(y),ymax=max(y),middle=mean(y))
}
qplot(data=diamonds[1:100,],x=color,
y=price)+stat_summary(fun.data=fun, geom='boxplot')
Please play with function fun() ,e.g., change the return value, but I
would like to note that the names of column of return value should be
consistent with the names of aes in geom_boxplot (see ?geom_boxplot).
HTH
-KO
2010/2/27 Giovanni Marco Dall'Olio <dallo...@gmail.com>:
Hi, I'm a newbie in ggplot2, so there may be more elegant solution.
As for the first question, they are documented in a web site:
http://had.co.nz/ggplot2/stat_boxplot.html
As for the second question, you can combine stat_summary and geom_boxplot:
fun<-function(y){
try_require("Hmisc")
ci<-smean.cl.boot(y)
data.frame(lower=ci["Lower"],upper=ci["Upper"],ymin=min(y),ymax=max(y),middle=mean(y))
}
qplot(data=diamonds[1:100,],x=color,
y=price)+stat_summary(fun.data=fun, geom='boxplot')