Learn R Programming

eodhdR2 (version 0.5.2)

parse_financials: Parses financial data from the API

Description

This function will organize the raw financial data from get_fundamentals(), aggregating all information into a single dataframe, including quarterly and yearly data from the Balance_sheet, Cashflow statement and Income statement. Whenever no financial data is found in l_out, the function returns an empty dataframe.

Usage

parse_financials(l_out, type_table = "long")

Value

A dataframe with organized financial data in the wide or long format

Arguments

l_out

A list with raw data (output from get_fundamentals())

type_table

Format of table in output ("wide" or "long"). A "wide" table is a typical Excel column-oriented table where each columns is a data/year. A long type of table row-oriented, where each each point of new information is a row of the table. The data is the same, it just changes the orientation of rows/columns. The default value is a "long" table.

Examples

Run this code
if (FALSE) {
set_token(get_demo_token())
l_out <- get_fundamentals(ticker = "AAPL", exchange = "US")

df_fin <- parse_financials(l_out, "long")
df_fin
}

Run the code above in your browser using DataLab