-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexploring_retail_dataexplorer.Rmd
139 lines (96 loc) · 2.49 KB
/
exploring_retail_dataexplorer.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
title: "Exploring the Cleaned Online Retail Dataset with DataExplorer"
author: "Mick Cooney <[email protected]>"
date: "Last updated: `r format(Sys.time(), '%B %d, %Y')`"
output:
rmdformats::readthedown:
toc_depth: 3
use_bookdown: TRUE
code_folding: hide
fig_caption: TRUE
html_document:
fig_caption: yes
theme: spacelab #sandstone #spacelab #flatly
highlight: pygments
number_sections: TRUE
toc: TRUE
toc_depth: 2
toc_float:
smooth_scroll: FALSE
pdf_document: default
---
```{r import_libraries, echo=FALSE, message=FALSE}
library(conflicted)
library(tidyverse)
library(scales)
library(cowplot)
library(magrittr)
library(rlang)
library(purrr)
library(vctrs)
library(fs)
library(glue)
library(forcats)
library(snakecase)
library(lubridate)
library(DataExplorer)
source("lib_utils.R")
conflict_lst <- resolve_conflicts(
c("magrittr", "rlang", "dplyr", "readr", "purrr", "ggplot2")
)
knitr::opts_chunk$set(
tidy = FALSE,
cache = FALSE,
warning = FALSE,
message = FALSE,
fig.height = 8,
fig.width = 11
)
options(
width = 80L,
warn = 1,
mc.cores = parallel::detectCores()
)
theme_set(theme_cowplot())
set.seed(42)
```
# Introduction
We previously performed a comprehensive data exploration of the retail dataset
using the `dataexpks` template, but now that we have removed and otherwise
filtered a number of other entries from the dataset.
As these removed rows may change the visualisation of the exploration, it is
worth doing a quick repeat of this exercise, so we perform those now using the
`DataExplorer` package.
# Load Data
We load up the cleaned dataset.
```{r load_dataset, echo=TRUE}
loaded_data_tbl <- read_rds("data/retail_data_cleaned_tbl.rds")
loaded_data_tbl %>% glimpse()
```
We now remove all excluded rows and run the exploration on the data with the
cleaned rows excluded.
```{r remove_excluded_rows, echo=TRUE}
retail_data_tbl <- loaded_data_tbl %>%
filter(exclude == FALSE)
retail_data_tbl %>% glimpse()
```
# Use DataExplorer Routines
## Intro Data
```{r plot_intro_data, echo=TRUE}
introduce(retail_data_tbl)
plot_intro(retail_data_tbl)
```
## Missing Values
```{r plot_missing_values, echo=TRUE}
plot_missing(retail_data_tbl)
```
```{r plot_bar, echo=TRUE}
plot_bar(retail_data_tbl)
```
```{r plot_histogram, echo=TRUE}
plot_histogram(retail_data_tbl, ncol = 2)
```
# R Environment
```{r show_session_info, echo=TRUE, message=TRUE}
sessioninfo::session_info()
```