[R] Bug with curve?

Paul Smith phhs80 at gmail.com
Fri Feb 1 14:54:59 CET 2008


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       i386-redhat-linux-gnu
arch           i386
os             linux-gnu
system         i386, linux-gnu
status
major          2
minor          6.1
year           2007
month          11
day            26
svn rev        43537
language       R
version.string R version 2.6.1 (2007-11-26)
>

Thanks in advance,

Paul



More information about the R-help mailing list