R code for quantitative analysis in finance