[R] xyplot, panel.abline, from, to

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Jul 28 17:16:35 CEST 2009


On Tue, Jul 28, 2009 at 6:58 AM, Peter Ehlers<ehlers at ucalgary.ca> wrote:
> David,
> ?panel.abline does not indicate that 'from/to' are arguments to
> that function. If you read the help page carefully, you'll see
> that 'from/to' apply to panel.curve(). Perhaps you thought that
> the '...' argument can take 'from/to'; again the help page makes
> it clear that those are to be *graphical* parameters.
>
> One quick fix would be to use panel.curve with, e.g. expr set to
> a + b*x:
> panel.curve(2 + .5*x, ...)

Yes, that would be my suggestion too, or using panel.segments

  fab <- function(x) a + b * x
  panel.segments(from, fab(from), to, fab(to))

-Deepayan




More information about the R-help mailing list