Thank you for the quick response! I think you are on the right track - but is there any way of "calling" (is that the word for it) the function price_call in the mapply, so that this price_call function is changed to handle vectors. I believe that this should, in theory if it is correct, make the result be values.
I have part of a code that works for only one vector. So maybe some where in the line of: callOptionkVec <- function(phi, kVec, t) { sapply(kVec,function(k) {callOption(phi,k,t)}) } is what I need to do. Do you have any ideas on how to do this? -- View this message in context: http://r.789695.n4.nabble.com/How-to-vectorize-a-function-to-handle-two-vectors-tp3771705p3771902.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.