Learn R Programming

alphavantagepf (version 0.3.2)

av_extract_df: Extract data from Alpha Vantage returned data

Description

av_extract_df() pulls out nested data.frames from mixed data returned by av_get_pf() av_extract_fx() returns a simplified FX quote in data.table formfrom av_get_pf() calls. av_extract_analytics() returns melted data.table from calls to av_get_pf("ANALYTICS_FIXED_WINDOW") or av_get_pf("ANALYTICS_SLIDING_WINDOW")

Usage

av_extract_df(indta, grepstring = "", melt = FALSE)

av_extract_fx(indta)

av_extract_analytics(indta, separate_vars = FALSE)

Value

Extracted data.tables for nested data returned from av_get_pf(), If grepstring is not specified, first nested table is returned. av_extract_fx() returns a shortened data.table with FX quotes.

Arguments

indta

A data.table as returned by av_get()

grepstring

select which variable (data item) to unnest in data.table returned from av_get_pf

melt

Return data in melted/normalized form

separate_vars

(default : FALSE) separate out multiple levels of variable names into new keys

Details

av_get_pf() frequently returns a nested data.table, or a structure with nested data.frames. These are utilities functions to extract, filter and summarize returned values.

See Also

av_get_pf(), av_grep_opts()

Examples

Run this code
if (FALSE) {
av_get_pf("","MARKET_STATUS")  |> av_extract_df()
av_get_pf("","TOP_GAINERS_LOSERS") |> av_extract_df("top_losers")
av_get_pf("USD/BRL","CURRENCY_EXCHANGE_RATE") |> av_extract_fx()
av_get_pf(c("ORCL","IBM"),"ANALYTICS_FIXED_WINDOW") |> av_extract_analytics(separate_vars=TRUE)
}

Run the code above in your browser using DataLab