Re: [R] Bug with curve?

2008-02-01 Thread Martin Maechler
> "BB" == Ben Bolker <[EMAIL PROTECTED]> > on Fri, 1 Feb 2008 14:03:15 + (UTC) writes: BB> Paul Smith gmail.com> writes: >> >> Dear All, >> >> Take this code: >> >> > f <- function(x) exp(-x)*x-0.05 >> > g <- function(x) 0 >> > curve(f,0,5)

Re: [R] Bug with curve?

2008-02-01 Thread Paul Smith
On Feb 1, 2008 2:46 PM, Martin Maechler <[EMAIL PROTECTED]> wrote: > >> Take this code: > >> > >> > f <- function(x) exp(-x)*x-0.05 > >> > g <- function(x) 0 > >> > curve(f,0,5) > >> > curve(g,add=T) > >> Error in xy.coords(x, y) : 'x' and 'y' lengths differ > >> > >

Re: [R] Bug with curve?

2008-02-01 Thread Alberto Monteiro
Paul Smith wrote: > >> f <- function(x) exp(-x)*x-0.05 >> g <- function(x) 0 >> curve(f,0,5) >> curve(g,add=T) >> Error in xy.coords(x, y) : 'x' and 'y' lengths differ >> > > However, with > > g <- function(x) x-x > > no error is generated. > > Is this a bug? > No; simplify it: g1 <- functio

Re: [R] Bug with curve?

2008-02-01 Thread Ben Bolker
Paul Smith gmail.com> writes: > > Dear All, > > Take this code: > > > f <- function(x) exp(-x)*x-0.05 > > g <- function(x) 0 > > curve(f,0,5) > > curve(g,add=T) > Error in xy.coords(x, y) : 'x' and 'y' lengths differ > > > > However, with > > g <- function(x) x-x > > no error is generated.

[R] Bug with curve?

2008-02-01 Thread Paul Smith
Dear All, Take this code: > f <- function(x) exp(-x)*x-0.05 > g <- function(x) 0 > curve(f,0,5) > curve(g,add=T) Error in xy.coords(x, y) : 'x' and 'y' lengths differ > However, with g <- function(x) x-x no error is generated. Is this a bug? I am using > version _ platform