Isn't a vector of vectors usually considered a matrix? So if you want to vectorize a vector function you would normally rewrite it to operate on matrices.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Newbie <lille_knold@hotmail.com> wrote:

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.


	[[alternative HTML version deleted]]

