The "array" command will work fine. But be warned: R is NOT designed to
be fast when looping through large multidimensional arrays. If you're
planning to use R to implement numerical solvers for highly complex
multiple-asset options (for instance), you'd be much better off writing
a program in C or C++ and then calling it from R. It's much faster and
more efficient.

On Thu, 2010-06-17 at 22:52 -0700, JOSH C. CHIEN wrote:

> Hi R user,
> I'm translating VBA code to R code for work.
> Here is example,  I hope your guys can guide me how to program multi-dimension array, s price path, on tree structure.
> 
> VBA Code
> Dim s() as double
> Dim v() as double
> ReDim s(0 To NoSteps, 0 To NoSteps)
> ReDim V(0 To NoSteps, 0 To NoSteps)
> 
> I just know that one-dimension array can be created by calling numeric() and two-dim by calling matrix(). 
> But, more two-dim array, how to create ? ( ex. trinomial Tree, HJM, BGM...... )
> Is it right way to code on programing in finance ?
> thanks a lot.
> 
> Sincerely,
> Josh
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
> 



	[[alternative HTML version deleted]]

