Monday, August 11, 2014

Fama/French Factors in 1 line of code

In the past, getting Fama/French factors from the Kenneth French dataset involved a convoluted procedure to download the zip file, unzip the file, clean the data, and convert to xts.  Now with Quandl, we can do it simply in one line of code.  Note:  this data is available in multiple formats (JSON, CSV, XML) from the API and for multiple code languages.

# use Quandl Kenneth French Fama/French factors


f <- Quandl(

f <- as.xts(f[,-1],[,1])

plot.zoo( f, main = NA )
text = "Fama/French Factors from Quandl"
, adj = 0
, outer = T
, line = -2
, cex = 2