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:
- Character manipulation: these functions allow you to manipulate individual characters within the strings in character vectors.
- Whitespace tools to add, remove, and manipulate whitespace.
- Locale sensitive operations whose operations will vary from locale to locale.
- 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)