[R] boxplot knowing Q1, Q3, median, upper and lower whisker value

Brian Diggs diggsb at ohsu.edu
Thu Sep 9 21:40:52 CEST 2010


On 9/6/2010 8:46 AM, David A. wrote:
>
> Dear list,
>
> I am using a external program that outputs Q1, Q3, median, upper and
> lower whisker values for various datasets simultaneously in a tab
> delimited format. After importing this text file into R, I would like
> to plot a boxplot using these given values and not the original
> series of data points, i.e. not using something like
> boxplot(mydata).
>
> Is there an easy way for doing this? If I am not wrong, boxplot()
> does not accept these values as parameters.
>
> Cheers,
>
> Dave  [[alternative HTML version deleted]]

If you use ggplot2, you can specify the aesthetics lower, upper, middle, 
ymin, and ymax directly to variables in geom_boxplot.  Just be sure to 
set stat="identity" so that it does not try to summarize your data again.

--
Brian Diggs
Senior Research Associate, Department of Surgery
Oregon Health & Science University



More information about the R-help mailing list