Re: [R] Integrating a function that contains for loop or vectorization for for loop

2020-07-19 Thread Rui Barradas
Hello, The functions are not equivalent. integrate subdivides the interval lower = 0, upper = 10 in into a maximum subdivisions = 100L. If you print length(X) you will see that it's 21. X is a vector of 21 values and to compute X^(1:10) this expands to X[1]^1, X[2]^2, ..., X[10]^10, X[11]^1,

Re: [R] Integrating a function

2007-11-06 Thread David Winsemius
Does this do any better, or perhaps offer other ideas? I could not understand what the "Hct" and step()'s were doing from the description of your desired result, so they were omitted from geq(). I also could not understand why you were rounding off the integrals or why there wee two integral te