[R] Re[2]: unfortunately, no such function, panel.segments

Deepayan Sarkar deepayan at stat.wisc.edu
Tue May 13 17:39:26 CEST 2003


On Tuesday 13 May 2003 10:14, Wladimir Eremeev wrote:
> Dear Douglas,
>
> >> plot.panel=function(x,y,...){
> >>   panel.xyplot(x,y,...);
> >>   panel.lmline(x,y,...);
> >>   panel.lmline(x[1:9],y[1:9],...);
> >>   panel.lmline(x[10:23],y[10:23],...);
> >>   panel.grid(h=-1,v=-1,...);
> >> };
> >>
> >> then I draw plots:
> >>   xyplot(<blah-blah-blah>,panel=plot.panel,<...>)
> >>
> >>   This command draws graphics, but all regression lines on them are
> >>   drawn from the left side to the right side, i.e. over the whole x
> >>   range...
>
> DB> I think you will need to do the linear model fits to the data subsets
> DB> within the panel function then use panel.segments to add the lines.
>
> But I've found lsegments, llines, and others.

Right, those are exactly what you want.

Deepayan




More information about the R-help mailing list