Hey Josh, Thanks for the quick response!
I guess I have to switch from the Java mindset to the matrix/vector mindset of R. Your code worked very well, but I just have one problem: Essentially I have a time series of stock A, followed by a time series of stock B, etc. So there are break points in the data (the points where it switches stocks have incorrect returns, and should be NA at t=0 for each stock) Is there an easy way to account for this in R? -- View this message in context: http://r.789695.n4.nabble.com/R-Newbie-please-help-tp2242633p2242697.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.