Hello,

I have been trying to make a graph that have error bars and text at specific position.

I used the following code from the help file of xYplot(Hmisc) as an example except I add a myPanel function, which is just supposed to add letters from the alphabet at the position aligned at y = 3.

It constantly gives me error:
"Error using packet 1 argument "subscripts" is missing, with no default".

The same code can work with xyplot from the lattice package (does not have error bar though).

Can somebody kindly offer some help?

Thanks,
Wen
dfr <- expand.grid(month=1:12, continent=c('Europe','USA'),
                   sex=c('female','male'))
set.seed(1)
dfr <- upData(dfr,
y=month/10 + 1*(sex=='female') + 2*(continent=='Europe') +
                runif(48,-.15,.15),
              lower=y - runif(48,.05,.15),
              upper=y + runif(48,.05,.15))

myPanel <- function(x, y, subscripts, ...) {
 panel.xYplot(x, y, ...)
 ltext(x, 3, letters[subscripts], cex=0.5)
 }
xYplot(Cbind(y,lower,upper) ~ month,subset=sex=='male' & continent=='USA',
       data=dfr, panel = myPanel)

______________________________________________
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