The finRes suite provides a
collection of packages developed to facilitate data-science and/or
research in finance and financial economics. In particular, it provides
helper packages for retrieving and storing locally financial data from
Bloomberg as well as for processing this data further for financial
modeling for example. finRes is
organised as a set of packages that work in harmony because they share
common data representations and ‘API’ design. This package is designed
to make it easy to install and load multiple
‘finRes’ packages in a single
step.
The development version can be installed from github using
devtools with
devtools::install_github("bautheac/finRes")
.
finRes is home to a number of packages that, although self-contained with consumption value on their own, host datasets that play important roles in the finRes suite, mostly in relation to data collection, storage and wrangling but also to analytics and asset pricing in particular. At the time of writing, the set of dataset packages in finRes includes: BBGsymbols, fewISOs, GICS, FFresearch and factors.
The finRes suite is organised
around the data-science pipeline where preprocessing, including data
collection and wrangling, plays a major role.
finRes addresses the issue in two
complementary packages that work in conjunction with most of the dataset
packages above.
On the one hand the pullit package
provides tools for data collection from Bloomberg. It returns clean and
tidy, ready-to-use, data objects for other packages further down the
pipeline to work with. On the other hand the
storethat package helps storing
the data retrieved with pullit for
off-Bloomberg consumption in R.
Both pullit and
storethat work in tandem with
the BBGsymbols package. The
latter plays a central role in
finRes where it provides the
former the semantic required to interact with Bloomberg through the
interface provided by the Rblpapi
package (Armstrong, Eddelbuettel, and Laing 2021).
At the time of writing, the analytics part of the pipeline in finRes focuses on asset pricing. On the one hand the FFresearch package abovementioned provides data on classic asset pricing factors and a number of sort portfolios. The data is pulled directly from Kenneth French’s data library and tidied up for seamless consumption in R. The factors package provides complementary datasets for other popular factors in the literature including those developed by Robert F. Stambaugh and collaborators: Lubos Pastor, Yu Yuan, etc. On the other hand the factorem package provides tools for outright factor construction from data retrieved with pullit. The returned objects carry corresponding return & positions time series and a number of methods to help with performance analysis.
The bottom-end of the pipeline (communication) is addressed in the plotit package that provides a number of plot methods for finRes objects.
finRes packages at the time of writing:
- BBGsymbols: popular
Bloomberg tickers and field symbols conveniently packaged for R users.
- fewISOs: a collection of
financial economics related ISO code datasets conveniently packaged for
consumption in R.
- GICS: Global Industry
Classification Standard dataset conveniently packaged for consumption in
R.
- FFresearch: Fama/French
asset pricing research data conveniently packaged for consumption by R
users.
- factors: Clean time series
datasets for asset pricing factors popular in the literature.
- pullit: Bloomberg financial
data collection in R made easy.
- storethat: store Bloomberg
financial data for off-Bloomberg consumption in R.
- factorem: construct bespoke
asset pricing factors.
- plotit: plot methods for the
finRes suite.
See package vignettes for details:
library(finRes)
vignette(topic = "datasets", package = "finRes")
vignette(topic = "Bloomberg", package = "finRes")
vignette(topic = "asset pricing", package = "finRes")
finRes is still in the alpha stage of development; bugs have to be fixed and design flaws must be addressed in some of the packages. Once these issues are addressed each individual package as well as the suite itself will eventually be submitted to the Comprehensive R Archive Network (CRAN) for larger public dissemination.
Armstrong, Whit, Dirk Eddelbuettel, and John Laing. 2021. Rblpapi: R Interface to ’Bloomberg’. https://CRAN.R-project.org/package=Rblpapi.