[R] adding text in (pair) panels (splom)

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sat Apr 10 04:17:04 CEST 2004


Hi,

I would like to add text in each panel got from the following:

splom(~Cs5bis,
panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x),...)
})

This could be a correlation coefficient or the statistical significance of the correlation or both, or a star if p < 0.05, etc...
The function text() is useless (probably because I cannot pass appropriates coordinates in each panel). Googling the R-archives, I
have found only one hint of Andy Liaw relating a rather complex (to me) script within a home-made panel.myfitline() function.

Is there a simple way to add text in panels created eg with:

panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x),...)
})

?

Any hint appreciated,

Patrick Giraudoux




More information about the R-help mailing list