Skip to main content
< All Topics
Print

Specifying your Windows R project directory (Replace by the location of your own project directory)

projdir = “C:/RExercise/”
setwd(projdir)

Loading data into R

The data table BH_OCC_wStatus-IDSorted_25-May-2021.csv should be downloaded into your R project directory from ( https://github.com/MoiraCorp/Compliance-Testing-Fairness-Assessment-using-R/blob/main/permid-preprocess/OCC_wStatus-IDSorted.csv )

Load the data table from your local Windows directory into R

OCC_wStatus <- read.table(“OCC_wStatus-IDSorted.csv”, header=TRUE, sep=”,”)

IMPORTANT Note: The file paths in R follow the Linux standard
so that the “\” character used in Windows file paths need to be changed to character “/”

Loading the necessary libraries

This training exercise uses several specialized R libraries:

IMPORTANT Note: Before using the “library” function in R, one needs to check that the correponding packages have been loaded from CRAN
Check R or RStudio documentation on how to install CRAN packages

Load theggplot2 graphics library

library (ggplot2)

Load plotly graphics library

library(plotly)

Load the FactoMineR library

library(FactoMineR)

Install library factoextra

library(factoextra)

Table of Contents