forked from vanderbilt-data-science/ancient-artifacts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path20-data-exploration.Rmd
More file actions
63 lines (50 loc) · 2.15 KB
/
Copy path20-data-exploration.Rmd
File metadata and controls
63 lines (50 loc) · 2.15 KB
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
---
title: "20-data-exploration"
output: html_notebook
---
The purpose of this notebook is for EDA. The values in this EDA notebook reflect restrictions on `f_width` to be between 0.125 and 6mm.
#Load and run functionality from loading notebook
```{r source data files, results='hide'}
source(knitr::purl("10-load-data.Rmd"))
fs::file_delete("10-load-data.R")
pacman::p_load(DataExplorer)
```
# Violin Plotting
Let's begin creating violin plots for variables of interested identified in previous studies
```{r fig.height=12,fig.width=12}
artifact_data %>%
select(everything(), -starts_with('filter')) %>%
pivot_longer(c(-id, -img_id, -particle_class)) %>%
ggplot(aes(x=particle_class, y=value, fill=particle_class)) +
geom_violin() +
facet_wrap(vars(name), scales='free_y')
```
Here we notice a significant difference between the distributions for transparency and circularly, particularly with the modes being so different.
Both solidity and length to width ratio may be candidates but both suffer from significant outliers skewing the plots
Finally, angularity has an interesting bimodal distribution which raises questions why both experimental and site particles experience similarly peaked bimodal distributions
In looking at some of the other variables, they have extremely long tails with most of the data sitting in a very small area. This can be for two reasons - 1) this is correct, and the tails are just long, or 2) there are a number of repeated rows which have identical values for these variables. This needs to be explored.
# Histogram Variable comparisons
Let's use the data explorer package on the experimental data
## Experimental Data
```{r}
artifact_data %>%
filter(particle_class == "exp" ) %>%
plot_histogram()
artifact_data %>%
filter(particle_class == "exp" ) %>%
plot_density()
# Full Report Creation (optional)
# artifact_data %>%
# filter(particle_class == "exp" ) %>%
# create_report()
```
## Site Data
And compare the output to what it looks like for the site data
```{r}
artifact_data %>%
filter(particle_class == "site" ) %>%
plot_histogram()
artifact_data %>%
filter(particle_class == "site" ) %>%
plot_density()
```