Skip to content

box-whisker plot from pre-summarized data?

2 messages · Avram Aelony, Hadley Wickham

#
Hello,

Although my summary descriptives are generated outside of R (dataset  
is huge), I would like to produce a box-whisker plot using bxp or  
perhaps a function from the ggplot2 library using the precomputed  
summaries.

My dataset currently contains 10 rows (one row per week) with the  
following columns: weekno (the week over which values have been  
summarized), minimum, 25th and 75th percentile, median, mean, and max  
values.  Any suggestions on how I can plot this in R to produce a box- 
whisker plot (one box per week of data) ?  I have seen http:// 
finzi.psych.upenn.edu/R/library/graphics/html/bxp.html but am not  
sure how to shape my summarized data correctly to produce the plot.

Many thanks in advance,
Avram
#
On Mon, Sep 29, 2008 at 4:27 PM, Avram Aelony <aavram at mac.com> wrote:
You should be able to do it like:

+ geom_boxplot(aes(ymin = lower.whisker, lower=lower.hinge,
middle=median, upper=upper.hinge, ymax=upper.whisker), stat =
"identity")

(where lower.whisker etc are the variables from your precomputed data set)

and then add on the outliers with geom_point

Hadley