[R] 'From' and 'to' arguments in panel.abline

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon Aug 13 22:03:27 CEST 2007


On 8/13/07, Sébastien <pomchip at free.fr> wrote:
> Dear R-users,
>
> The help does not give much details on the use of the arguments 'from'
> and 'to' in the panel.abline function.

Not surprising, since panel.abline doesn't actually have arguments
called 'from' and 'to'.

> I have looked in the archives but
> did not find how to implement them. My different tries failed miserably.
> E.g, the following code doesn't seem to work, in a sense that the line
> is not limited to the (0,10) range.
> Do these arguments really apply to panel.abline?

No, they do not. It is common to have many functions documented in one
help page, and you need to look at the usage section (near the top) to
figure out which arguments are releant for which functions. The help
page has:


Usage:

     panel.abline(a = NULL, b = 0,
                  h = NULL, v = NULL,
                  reg = NULL, coef = NULL,
                  col, col.line, lty, lwd, type,
                  ...)

     panel.curve(expr, from, to, n = 101,
                 curve.type = "l",
                 col, lty, lwd, type,
                 ...)

etc. If you want to limit the range, use panel.curve, e.g.

  panel.curve(0 + 1 * x,from=0,to=10)

-Deepayan


> If so, how should they
> be specified?
>
> xy<-data.frame(x<-0.1:10,y<-0.1:10)
> xyplot(y~x,data=xy,
>              panel = function(x, y, ...){
>        panel.abline(a=0,b=1,from=0,to=10)
>        panel.xyplot(x,y)
>        })
>
> Thanks you in advance for your help.
>
> Sebastien
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list