{optiRum} is a stable package of utilities created by Optimum Credit Ltd’s analysts.It is designed to provide convenience functions, standards, and useful snippets. Optimum Credit derives significant value from the R platform and associated community, so non-commercially sensitive functionality is made available in the spirit of reciprocity.
The latest stable version of the package is available on CRAN, and you can get the latest development version by running:
devtools::install_github("jumpingrivers/optiRum")
We have a range of financial functions that follow the Excel conventions.
PV
– present valuePMT
– instalmentRATE
– interest rateAPR
– produces the annual compound rate needed for UK financial services
As we’ve been doing more on calculating income and expenditure, we have included some generic functions that help calculate values for the UK tax system
taxYear
provides the year that a date would belong to. It can be overridden to use any tax year, but this provides a means for moving between changing tax values over timecalcNetIncome
gives the ability to calculate UK net income figures based off personal circumstances and tax tables
There are functions for credit analysts and people dealing with logistic regressions:
- the logit, odds and probability functions enable the conversion from logit to probability, vice versa and anywhere in between – great for handling glm outputs
scaledScore
– this produces the scores that companies are used to working with for the assessment of credit qualityginiChart
andginiCoef
– produces a Gini chart in keeping with the Optimum style and embeds the coefficient, whilst the standalone giniCoef function allows for extracting a value or a series of values for use
There are helper functions that reduce document development time:
sanitise
– handles special characters for LaTeX documents, including situations where you have unresolved square brackets at the beginning which is great if you’ve usedcut2
and want to show summary stats for intervalsgeneratePDF
– allows the production of PDFs in a one-linermultiplot
– allows the plotting of multiple charts into one area, primarily of benefit when producing figures for documentspounds
– displays values with a UK pound symbol at the front with UK decimalisation practices, this extends scalesthousands
– displays values to the nearest thousand and in a condensed format that is ideal for charts, this extends scalestheme_optimum
– this produces a good looking frame for chartsconvertToXML
– a lot of people are concerned about getting data out of XML, but it’s difficult to find functions that put output data in XML, so this function takes XML functionality and wraps it neatly for such casesCJ.dt
– a cross-join function for two data.tableswordwrap
= Change spaces to new lines in a string - great for plotting
Please note that the optiRum project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.