-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataCleaning.Rmd
56 lines (37 loc) · 901 Bytes
/
dataCleaning.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: "Data Cleaning"
author: "Aleksander Brynjulf Hübert"
date: "04/05/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, warning=FALSE}
library(tidyverse)
library(ggplot2)
```
```{r}
bankData <- read.delim("data/bank-full.csv", sep =";" ,header = T, strip.white = TRUE)
#creates a dataset that keeps NAs as 'unknown'
bankDataUnkown <- bankData
#changes 'unknown' to NA
bankData[bankData == "unknown"] <- NA
sum(is.na(bankData))
sum(is.na(bankData$contact))
sum(is.na(bankData$poutcome))
#for testing the logistic regression without NAs
bankData <- bankData[,-16]
bankData <- na.omit(bankData)
ggplot(bankData, aes(y))+
geom_bar()
```
```{r}
library(corrplot)
##correlations of NA values will go here
corrmat <- model.matrix(~. -1, bankDataUnkown)
correlations <- cor(corrmat)
corrplot(correlations)
```
```{r}
```