parse_financials {eodhdR2} | R Documentation |
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")
Arguments
l_out |
A list with raw data (output from |
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. |
Value
A dataframe with organized financial data in the wide or long format
Examples
## Not run:
set_token(get_demo_token())
l_out <- get_fundamentals(ticker = "AAPL", exchange = "US")
df_fin <- parse_financials(l_out, "long")
df_fin
## End(Not run)