Try the code below:
library(pracma)
f <- function(x) 1
integrate(f,0,1)$value
quad(f,0,1)
quad() works correctly but integrate() reports the error message:
Error in integrate(f, 0, 1) : evaluation of function gave a result of wrong length
What is wrong with this integrate() application? Thanks in advance!