Re: [R] Boxplot labels

From: Marc Schwartz (via MN) <>
Date: Fri 21 Oct 2005 - 06:57:02 EST

On Thu, 2005-10-20 at 15:41 -0500, Marc Schwartz (via MN) wrote:
> On Thu, 2005-10-20 at 14:46 -0400, Keith Sabol wrote:
> > I am creating boxplots from a dataframe and would like to add to the
> > standard output a marker representing the value from a particular row in the
> > dataframe.
> >
> > .....And I apologize if the solution is as trivial as it seems it should be.
> >
> > Thanks for any assistance.
> >
> > Keith
> Some example code would be helpful here.
> However, some hints that I suspect will be helpful:
> 1. Unless you use the 'at' argument in boxplot(), the box center
> positions are at integer values from 1:n, where n is the number of
> groups.
> 2. You can thus use the points() function to add symbols or the text()
> function to add labels to the existing plot as you may require.
> See ?points and/or ?text for more information.

One other note to add here is that boxplot() will return a list which contains various stats about your grouped data. This requires using the form:

  stats <- boxplot(...)

Thus using the 'stats$group' and 'stats$out' components will give you the x and y positions of any outliers. This will be helpful if these are the values that you might want to identify

See the "Value" section in ?boxplot and ?boxplot.stats for more information.

HTH, Marc mailing list PLEASE do read the posting guide! Received on Fri Oct 21 08:13:03 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 19:14:44 EST