[R] Adding a symbol/value to a boxplot in R

Johannes Graumann johannes_graumann at web.de
Thu Nov 5 09:30:54 CET 2009


boxplot(cars[[2]])
points(1,cars[[2]][34],col="red")
text(1,cars[[2]][34],labels=c("Like this?"),col="red",pos=4)

HTH, Joh

Marc Giombetti wrote:

> Hello everybody,
> 
> I am new to R and I am having the following problem.
> I have the following boxplot:
> 
> boxplot(s$Estimate,u$Estimate,names=c("Security", "Usability"))
> title(main="Estimated development time",ylab="Estimate (weeks)")
> 
> http://i35.tinypic.com/2rhw9rm.jpg
> 
> but I want to add a label or symbol for a specific value to every
> boxplot. I uploaded a screenshot
> of a boxplot I generated using Excel which I try to replicate using R.
> In this example my dataset
> "usability" which is represented in the boxplot should be compared to
> another value 84 (highlighted in red)
> This value is not in the dataset u$Estimate.
> 
> http://i35.tinypic.com/24n0020.jpg
> 
> Can I use some overlay per boxplot to add a specific value?
> 
> I appreciate your help!
> 
> thanks a lot,
> 
> Marc




More information about the R-help mailing list