Description Usage Arguments Details Value Batching References Examples
This is a replacement for Quandl::Quandl.datatable which allows for multiple attempts, batches long parameters into multiple requests, always fetches all results, and always returns a tibble.
1 | quandl_datatable(code, ..., .batch = 50L)
|
code |
< |
... |
filters and options to pass as parameters |
.batch |
< |
Results are requested in CSV form and converted to a tibble via
readr::read_csv()
.
<tbl_df
> Results from Quandl in tibble form.
The Quandl API can only support a limited number of parameters in one call.
If we want to filter on e.g. 1000 tickers, that requires multiple requests
to complete. This wrapper will handle this for you, automatically making
multiple requests to fetch the desired output. Currently, only one ...
input can be longer than .batch
, so you can't filter on e.g. both 1000
tickers and 1000 dates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | quandl_key_set()
# get one day of prices on Apple from Wiki Prices
quandl_datatable("WIKI/PRICES", ticker = "AAPL", date = "2018-01-02")
# get one month of prices from two tickers
quandl_datatable(
"WIKI/PRICES",
ticker = c("AAPL", "MSFT"),
date.gte = "2018-01-01",
date.lt = "2018-02-01"
)
# only return some columns
quandl_datatable(
"WIKI/PRICES",
ticker = "AAPL",
date = "2018-01-02",
qopts.columns = c("date", "ticker", "close")
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.