Skip to contents

This vignette explains the functions offered by 'financr'.

Overview

Source. Yahoo Finance is used consistently as a data source across the package.

Inputs. Each function expects a specific type of input, based on its prefix.

Prefix Example Expected_input
search_ search_assets('Saab') Free-text(s)
get_ get_historic('^DJI') Financial symbol(s) such as a ticker symbol1 (e.g., ‘AAPL’) or ISO 3-letter currency code2 (e.g., ‘USD’)
last_ last_indices() Do not require any input. All arguments are optional

Outputs. All the 'financr' functions return a standardized data.frame, see the last section ‘Return Conventions’.

Functions with the '_historic' suffix return an historic of financial data, while the others retrieve latest financial data.


Details

search_ family.

Functions with the prefix 'search_' retrieve latest data and expect free-text input(s).
Example Returned data.frame
search_assets('Saab', get_values = T) Assets names, ticker symbols, latest insights and financial values
search_assets('Saab') Assets names and symbol(s) associated with the texts searched
search_assets_quick('Saab') Assets names and symbol(s) associated with the text searched

get_ family.

Functions with the prefix 'get_' retrieve the historical or latest financial values, given financial symbol(s)
Example Input Returned data.frame
get_historic('SDV1.F')
& get_historic_light('SDV1.F')
Asset symbol(s), such as ticker symbols Historic of financial data
get_values('SDV1.F') Asset symbol(s) Latest insights and financial values
get_similar('SDV1.F') Asset symbol(s) Latest symbols associated with those provided and similarity scores
get_changes('USD', 'EUR') ISO currency code(s) Latest exchanges rates
get_changes_historic('USD', 'EUR') ISO currency code(s) Historic of exchanges rates

last_ family.

Functions with the prefix 'last_' retrieve latest data and do not require any input (all arguments are optional).
Example data.frame_returned
last_market_summary() Latest summary information for a set of major financial market indices*
last_indices() World indices latest insights and values (USD)
last_currencies() ISO currency codes for currencies, names and (optionally) latest values* (USD)
last_crypto() 100 major crypto-currencies latest insights and values (USD)

See the vignette of the ‘last_’ functions.

vignette("last_family", package = "financr")


Other function.

Other helper functions
Example Input Data.frame_returned
valid_symbol("SAABF") Text(s) to verify (logical values) Validity of financial symbol(s)

Return Conventions

Regarding a data.frame returned by 'financr' functions, the column names are:

  • following the ‘snake_case’ conventions3, e.g., in lowercase and without spaces;
  • and symbols are replaced (e.g., “%’ is replaced by ‘percent’).