[R] Question about adding text to xYplot(Hmisc)

From: Wen Huang <whuang.ustc_at_gmail.com>
Date: Thu, 29 May 2008 22:41:20 -0500


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_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. Received on Fri 30 May 2008 - 03:45:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 30 May 2008 - 06:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive