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,

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

2020-07-19 Thread Shaami
Hi Everyone It has been a long time I am facing a problem with integrating a function that contains for-loop or even vectorization of for loop. Could you please guide for the following MWE that how I could get rid of the error or warning messages? My MWE code is here: myfun <- function(X, a, b){