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

2007-08-13 Thread Sébastien
Dear R-users,

The help does not give much details on the use of the arguments 'from' 
and 'to' in the panel.abline function. 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? 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@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.


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

2007-08-13 Thread Deepayan Sarkar
On 8/13/07, Sébastien [EMAIL PROTECTED] 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@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.


__
R-help@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.


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

2007-08-13 Thread Sébastien
Thanks Deepayan,

I actually looked at the upper section but couldn't not spot these 
arguments. I thought they were optional arguments in '...'. I will try 
to open my eyes next time ;)

Deepayan Sarkar a écrit :
 On 8/13/07, Sébastien [EMAIL PROTECTED] 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@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.

 

[[alternative HTML version deleted]]

__
R-help@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.