[R] moving columns on a stripchart closer together

S Ellison S.Ellison at lgc.co.uk
Tue Jul 21 12:55:53 CEST 2009


I agree; the stripchart defaults place things too close to the edges for
'neat' layout.

Use at= coupled with ylim (or xlim, if vertical) to place the rows
explicitly and leave room at the margins.

Extending the last example in ?stripchart:

     stripchart(decrease ~ treatment,
         main = "stripchart(OrchardSprays)", 
         vertical = TRUE, log = "y", data = OrchardSprays,
         at=1:8, xlim=c(0.5,8.5) )

#Get the group means
OS.means<-with(OrchardSprays, tapply(decrease, treatment, mean) )

#Plot horizontal line segments at each mean
segments(1:8-0.2, OS.means, 1:8+0.2, OS.means, lwd=2)




>>> Leslie J Seltzer <lseltzer at wisc.edu> 20/07/2009 22:22:05 >>>


Greetings

I have a very simple question that I have not been able to solve by
reading the manual. When I produce a stripchart with two straight
columns of dots representing individual observations, one representing
one group of subjects and the other representing another, the columns
wind up at the far left and far right sides of the plot, and I'd like
them to be closer together, about as far apart as they'd be if I used
the boxplot function. I would also like to add a short horizontal line
where the mean is for each of the columns, so that my readers can see
the results of my significant t test graphically.

Any assistance in moving my columns together and adding just a short
horizontal line for the mean of each would be great.

Sincerely,

Dr. Leslie J. Seltzer
University of Wisconsin-Madison
382 Waisman Center
1500 Highland Ave
Madison, WI 53705
PHONE: (608) 886 6067
www.waisman.wisc.edu/childemotion 

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code.

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}




More information about the R-help mailing list