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
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. > > KeithSome 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. HTH, Marc Schwartz
Here's one approach. values <- c(rnorm(1000,-5,1),rnorm(1000,10,0.5)) boxplot(values) text(1,0,labels="better use violin plots",col="red") #------ require(vioplot) vioplot(values) text(1,0,labels="better than box plots",col="red",pos=4)> -----Original Message----- > From: Keith Sabol [mailto:sabolk at hotmail.com] > Sent: Thursday, October 20, 2005 2:46 PM > To: r-help at stat.math.ethz.ch > Subject: [R] Boxplot labels > > > 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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >