[R] Display grouping parameter in coplot

Dieter Menne dieter.menne at menne-biomed.de
Tue Mar 13 15:19:22 CET 2001


I try to display the grouping variable in coplot.
It work, but it's special solution and rather ugly.
Any better idea?

# Simulate my data frame
data(state)
x77<-data.frame(state.x77)
x77$region<-state.region

coplot(Life.Exp ~ Income | region,
     data=x77, show.given=F,     subscripts=T,
     panel = function(x, y,subscripts, ...)
     {
       panel.smooth(x, y, span = 1., ...)
       # Shuddrr....
       # There must be way to access the grouping parameter
       leg<-as.character(x77$region[subscripts][1])
       legend(3000,74,leg,bty="n")
     }
     )


---------------------------------------
Dr. Dieter Menne
Biomed Software
72074 Tübingen
Tel (49) (7071) 52176
FAX (49) (7071) 55 10 46
dieter.menne at menne-biomed.de
www.menne-biomed.de

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list