Downloading FRED data with quantmod: can dates be specified?

后端 未结 3 1890
梦毁少年i
梦毁少年i 2021-01-18 00:14

I am downloading data from FRED with the quantmod library (author Jeffrey A. Ryan). With Yahoo and Google data, I am able to s

3条回答
  •  臣服心动
    2021-01-18 01:00

    Alternatively you can download FRED data from Quandl (http://www.quandl.com/help/r) which offers more than 4 million datasets including all of the FRED data. There is an API and R package available. ("Quandl"). Data can be returned in several formats formats e.g. data frame ("raw"), ts ("ts"), zoo ("zoo") and xts ("xts"). For example to download GDPPOT10 and specify the dates and have it returned as an xts object all you have to do is:

    require(Quandl)
    mydata = Quandl("FRED/GDPPOT", start_date="2005-01-03",end_date="2013-04-10",type="xts")
    

提交回复
热议问题