[Rd] integrate function (PR#9557)

Bert.DeBoeck at Ugent.be Bert.DeBoeck at Ugent.be
Thu Mar 8 15:56:35 CET 2007


Full_Name: Bert De Boeck
Version: R 2.2.0
OS: Windows
Submission from: (NULL) (157.193.193.152)


I think there is a bug when using integrate for integrating a function which is
0 in a whole sub-interval. For example:

#define uniform function
f<-function(x){ifelse(x<1,0,ifelse(x<3,1,0))}

#this is the correct integral
integrate(f,-10,10)

#here there is a problem
integrate(f,-50,50)
integrate(f,-10,50)
integrate(f,-50,10)
integrate(f,-50,50,sub=10000)

# I noticed this for a more complex function, but as you see even for a trivial

# function there is a serious problem



More information about the R-devel mailing list