simfinR_get_single_fin_statement: Fetch financial data for a single company

Description Usage Arguments Value Examples

View source: R/get_single_fin_statement.R

Description

This is a helper function for simfinR_get_fin_statements. It will make calls to the simfin api and save the results in cache.

Usage

1
2
3
4
5
6
7
8
simfinR_get_single_fin_statement(
  id_sim,
  type_statement,
  period_in,
  year,
  api_key,
  cache_folder
)

Arguments

id_sim

Simfin id of a company (single value)

type_statement

Type of financial statements ('pl' - profit loss, 'bs' - balance sheet, 'cf' - cashflow)

period_in

Time periods to grab the data: 'FY' - fiscal year (only for 'pl' and 'cf', use 'Q4' for end of year 'bs'), 'Q1' - first quarter, 'Q2', 'Q3', 'Q4'

year

The year

api_key

Your api key

cache_folder

The directory to cache results

Value

A single dataframe with the data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

id_companies <- 59265
api_key <- 'YOURAPIHERE'

df_single_fin <- get_single_fin_statement(id_sim = id_companies, type_statement = 'pl',
                                          period_in = 'FY', year = 2018, api_key=api_key,
                                          cache_folder = 'simfim_cache')

## End(Not run)

simfinR documentation built on April 2, 2021, 5:06 p.m.