[R] panel argument in coplot

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jan 17 16:38:57 CET 2001


"Peter B. Mandeville" wrote:
> 
> How can I add a least squares line to each panel in coplot?
> 
> Thank you very much.

Let's extend the last example from the help to coplot():

 data(state)
 attach(data.frame(state.x77))
 coplot(Life.Exp ~ Income | Illiteracy * state.region, number = 3,
   panel = function(x, y, ...) {points(x, y, ...); abline(lm(y~x))})
 detach()

So just change the function for the argument 'panel'.

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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