fetchSeries: Fetch time series data

Description Usage Arguments Value Examples

View source: R/fetch.R

Description

This is the main function that pulls data directly from Alpha Vantage into a convenient xts object. This is a general function that reflects exactly the documentation listed online.

Usage

1
fetchSeries(function_nm, ...)

Arguments

function_nm

The function name. While case insensitive, this argument needs to be exactly as listed in the documentation. Examples include time_series_daily, sma, and bbands.

...

Other arguments. If a required argument is missing then an error will be thrown. If an optional argument is missing then a warning will be thrown.

Value

A two element list: the first element is the xts object named xts_object and the second is the raw http response named httr_response (see httr package for details on this class)

Examples

1
2
3
4
setAPIKey()
example_prices <- fetchSeries(function_nm = "time_series_daily", symbol = "msft")
example_sma <- fetchSeries(function_nm = "sma", symbol = "msft", interval = "daily",
                           time_period = 10, series_type = "open")

AlphaVantageClient documentation built on May 2, 2019, 6:49 a.m.