On 09/25/2013 01:56 AM, Sagan Friant wrote:
Thank you!  This worked beautifully.  Can you help me adapt the code to
do the same thing for a plot of means? The application is not a simple
as I hoped...

plotMeans(rich.small$ALL, rich.small$sample, error.bars="se")
...

Hi Sagan,
Let's see, plotMeans is in the Rcmdr package. After installing it, I couldn't get it to plot, but upon exiting the Rcmdr window I worked out that the second argument (factor1) must obviously be a factor. After correcting this:

rich.small<-data.frame(ALL=rnorm(240,5),
 sample=factor(c(rep(0,60),rep(2,50),rep(4,40),
 rep(7,30),rep(10,30),rep(18,30))))

I get a plot, but I can see no way of adjusting the positions of the means displayed. I suggest:

plot(c(0,10,13,16,19,94),
 by(rich.small$ALL,rich.small$sample,FUN=mean),
 xaxt="n",ylim=c(4.7,5.4))
library(plotrix)
dispersion(c(0,10,13,16,19,94),
 by(rich.small$ALL,rich.small$sample,FUN=mean),
 by(rich.small$ALL,rich.small$sample,FUN=std.error))
staxlab(1,at=c(0,10,13,16,19,94),labels=c(0,2,4,7,10,18))

Jim

______________________________________________
R-help@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.

Reply via email to