Displaying 1 result from an estimated 1 matches for "integrandtotest3".
Did you mean:
integrandtotest
2005 Sep 16
4
Integrate functions with loops
...evaluation of function gave a result of wrong length
In addition: Warning messages:
1: number of items to replace is not a multiple of replacement
length
2: number of items to replace is not a multiple of replacement
length
#######
I then tried a vector multiplication instead of the for loop
integrandtotest3 <- function(x)
{b<-c(t[1],t[2])
a<-b^x
sum(a)
}
which gave errors
########
Error in integrate(integrandtotest3, lower = 0.1, upper = 2,
subdivisions = 10000) :
evaluation of function gave a result of wrong length
In addition: Warning message:
longer object le...