Dear list members,
I would like to create two series of plotted mean values and error bars, yet with different locations along the x-axis. Plotting of first series using plotCI with the standard arguments goes without any problem. However I do not succeed to add the second series in the same plot, which should be horizontally shifted from the first series along the x-axis. The âadd=TRUEâ argument works well. Is there any argument defining the series location within plotCI. For example the tool âboxplotâ contains the âatâ argument. I found examples of plotCI where a vertical shift is realized (e.g. âx=means+1e5â), never a horizontal shift. Here you find data information: ##data value1<-c(1,2,1,2,1,3,4,2,6,1,3,4,2,6) value2<-c(1,5,1,2,4,4,4,3,3,1,3,4,9,8) typo<-c("C","C","C","C","A","A","A","A","A","B","B","B","B","B") tab1<-data.frame(data=cbind(value1,value2,typo)) colnames(tab1)<-c("value1","value2","typo")  tab1$value1<-as.numeric(tab1$value1) tab1$value2<-as.numeric(tab1$value2) ##mean and error first data series tmp <- split(tab1$value1,tab1$typo) means <- sapply(tmp, mean) stdev <- sapply(tmp, sd) n <- sapply(tmp,length) ciw <- qt(0.975, n) * stdev / sqrt(n) ##plotting first data series plotCI(x=means,uiw=stdev, col="red", barcol="red", lwd=3, pch=18, cex=2, xaxt="n", yaxt="n", ylab='benefit',xlab='typo', yaxs = 'i',ylim=c(0,8)) axis(side=1, at=1:3, labels=names(tmp), cex=0.7)  ##mean and error second data series tmp <- split(tab1$value2,tab1$typo) means <- sapply(tmp, mean) stdev <- sapply(tmp, sd) n <- sapply(tmp,length) ciw <- qt(0.975, n) * stdev / sqrt(n) ##the problem: plotting second dataseries plotCI(x=means, uiw=stdev, col="steelblue", barcol="steelblue", lwd=2, pch=18, cex=2, xaxt="n", yaxt="n", ylab='qualite',xlab='type', yaxs = 'i',add=T) ##this series of data is now superposed, but would like to put them horizontally shifted next to the red values Thanks in advance, Rosalinde Van Couwenberghe [[alternative HTML version deleted]]
______________________________________________ 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.