We are currently working on constructing a portfolio in R, using daily data of thousands of stocks over the period of 40 years (about 40 million observations). It is structured