R Correlations Between Assets

R Learning Resources

More Books About R on Amazon

R Program


This code is based upon the R code available from the Bogelheads Wiki .

It calculates the correlations between historic quotes available for Yahoo for the user provided ticker symbols, creates a scatterplot matrix for the symbols, provides some decriptive statistics, and plot the quotes for the first seven symbols over time.

It requires two inputs, ticker symbols and start date. Both files need to have a variable name in the first row, it can be anything you like. Ticker symbols need to be something that Yahoo recognizes, and are case senstive. The start date should be in the form YYYY-MM-DD.

Test Data


Comma separated data, with column names in first row


Comma separated data, with column names in first row