Problem integrating a option_model in R

Hello

I would like to estimate the parameters of an option_model below ***. It works over one point/day but over several points/days i got an error message "Error in integrate(P1, lower = 0, upper = Inf, S, X, tau, r, q, v0, vT, : evaluation of function gave a result of wrong length". I know it is a matter of vectorisation.
For example with the below sample, i would like to estimate over the full sample the five parameters (v0, vT, rho, k, sigma).

Any other code for equivalent model is okay. Thanks for any help.

|S | K | r | T | vol | black_scholes_price | call_price|
|10 | 5 | 0 | 0.0833333333333333 | 0.1 | 5 | 5.04015662835657|
|10 | 5 | 0 | 0.0833333333333333 | 0.2 | 5 | 4.85949388084548|
|10 | 5 | 0 | 0.0833333333333333 | 0.3 | 5 | 5.08943090813426|
|10 | 5 | 0 | 0.0833333333333333 | 0.4 | 5 | 4.95319345262156|
|10 | 5 | 0 | 0.166666666666667 | 0.1 | 5 | 5.05969686378105|
|10 | 5 | 0 | 0.166666666666667 | 0.2 | 5 | 4.92278056639807|
|10 | 5 | 0 | 0.166666666666667 | 0.3 | 5 | 4.9172201320526|
|10 | 5 | 0 | 0.166666666666667 | 0.4 | 5 | 4.93092494872619|
|10 | 5 | 0 | 0.25 | 0.1 | 5 | 4.55768128699368|
***R: Price of a European Call under the Heston Model

Well it seems that my post has no success :wink: it is a question of posting or not a draft code maybe? or subject ?