GetQuandlData (version 0.1.0)

get_Quandl_series: Import data from Quandl API

Description

Uses the json api from Quandl (<https://www.quandl.com/tools/api>) to import data into an R session. The great benefit from the original Quandl::Quandl is the use of package memoise to cache results, organization of the output dataframe in the tidy/long format and passing different multiple parameters to manipulate series.

Usage

get_Quandl_series(id_in, api_key = NULL, first_date = Sys.Date() - 365,
  last_date = Sys.Date(), do_cache = TRUE, order = "asc",
  collapse = "none", transform = "none",
  cache_folder = "quandl_cache")

Value

A dataframe in the long format

Arguments

id_in

Character vector of ids to grab data. When using a named vector, the name is used to register the time series. Example: id_in <- c('US GDP' = 'FRED/GDP')

api_key

YOUR api key (get your own at <https://www.quandl.com/sign-up-modal?defaultModal=showSignUp>)

first_date

First date of all requested series as YYYY-MM-DD (default = Sys.date() - 365)

last_date

Last date of all requested series as YYYY-MM-DD (default = Sys.date() - 365)

do_cache

Do cache? TRUE (default) or FALSE. Sets the use of package memoise to cache results from the api

order

How to order the time series data: 'desc' (descending dates, default) or 'asc' (ascending)

collapse

Frequency of time series: 'none' (default), 'daily', 'weekly', 'monthly', 'quarterly', 'annual'

transform

Quandl transformation: 'none', 'diff', 'rdiff', 'rdiff_from', 'cumul', 'normalize'. Details at <https://docs.quandl.com/docs/parameters-2>

cache_folder

Folder where to save memoise cache files

Details

ATTENTION: You'll need a api key in order to use this function. Get one at <https://www.quandl.com/sign-up-modal?defaultModal=showSignUp>.

Examples

Run this code

api_key <- 'YOUR_API_KEY_HERE'
id_in <- c('Inflation argentina' = 'RATEINF/INFLATION_ARG')
if (FALSE) {
 df <- get_Quandl_series(id_in = id_in, api_key = api_key)
 }

Run the code above in your browser using DataLab