Credit Risk Modelling - Required R Packages

During our analysis, we will make use of various R packages. So, let’s look at what these packages are and let’s install and load them in R.

Dplyr

‘Dplyr’ provides a set of tools for efficiently manipulating datasets in R. The problem in most data analyses is the time it takes for you to figure out what to do with your data, and dplyr makes this easier by having individual functions that correspond to the most common operations (group_by, summarise, mutate, filter, select and arrange). Each function does one only thing, but does it well.

Install and Load dplyr

> install.packages('dplyr’)

library(dplyr)

Stringr

There are four main families of functions in stringr:

  1. Character manipulation: these functions allow you to manipulate individual characters within the strings in character vectors.
  2. Whitespace tools to add, remove, and manipulate whitespace.
  3. Locale sensitive operations whose operations will vary from locale to locale.
  4. Pattern matching functions. These recognise four engines of pattern description. The most common is regular expressions, but there are three other tools.

> install.packages('stringr')

library('stringr')

ggplot2

Data visualization library

> install.packages(‘ggplot2’)

library('ggplot2’)

Caret

Classification and Regression Training

install.packages(‘caret') library(caret)

lubridate

This package makes dealing with dates a little easier.

install.packages("lubridate") library(lubridate)

corrplot

Visualization of a correlation matrix

install.packages("corrplot") library(corrplot)

rms

Regression Modelling Strategies

install.packages("rms") library(rms)

doMC

install.packages("doMC") library(doMC)

pROC

install.packages("pROC") library(pROC)

e1071

> install.packages(“e1071")

library(e1071)

Kernlab

> install.packages(“kernlab") library(kernlab)

xgboost

install.packages(“xgboost") library(xgboost)

Related Downloads

Data Science in Finance: 9-Book Bundle

Data Science in Finance Book Bundle

Master R and Python for financial data science with our comprehensive bundle of 9 ebooks.

What's Included:

  • Getting Started with R
  • R Programming for Data Science
  • Data Visualization with R
  • Financial Time Series Analysis with R
  • Quantitative Trading Strategies with R
  • Derivatives with R
  • Credit Risk Modelling With R
  • Python for Data Science
  • Machine Learning in Finance using Python

Each book includes PDFs, explanations, instructions, data files, and R code for all examples.

Get the Bundle for $29 (Regular $57)
JOIN 30,000 DATA PROFESSIONALS

Free Guides - Getting Started with R and Python

Enter your name and email address below and we will email you the guides for R programming and Python.

Data Science in Finance: 9-Book Bundle

Data Science in Finance Book Bundle

Master R and Python for financial data science with our comprehensive bundle of 9 ebooks.

What's Included:

  • Getting Started with R
  • R Programming for Data Science
  • Data Visualization with R
  • Financial Time Series Analysis with R
  • Quantitative Trading Strategies with R
  • Derivatives with R
  • Credit Risk Modelling With R
  • Python for Data Science
  • Machine Learning in Finance using Python

Each book comes with PDFs, detailed explanations, step-by-step instructions, data files, and complete downloadable R code for all examples.