-
Notifications
You must be signed in to change notification settings - Fork 0
/
Analysis2_Graphs_Vertical.Rmd
117 lines (93 loc) · 3.38 KB
/
Analysis2_Graphs_Vertical.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
---
title: 'Analysis 1 - Normalization by Country & Category (Vertical)'
author: "Nicole Birkner"
date: "10/25/2020"
output:
html_document: default
word_document: default
pdf_document: default
---
```{r setup, include=FALSE}
library(dplyr)
library(tidyverse)
library(stats)
library(readxl)
getwd()
df <- read_xlsx("Vertical_Matrix.xlsx")
```
## Word 1
```{r}
w1 <- df %>% filter(w1_perc!=0)
library(ggplot2)
p<-ggplot(w1, aes(x=factor(Category, levels=c("Geography & Language",
"Race & Ethnicity", "Otherness","Negative", "Neutral", "Positive",
"Culture", "Others & Unsure")), y = w1_perc, fill=Country)) +
geom_bar(stat="identity", position=position_dodge())
p + labs(title="Word 1") +
xlab("Category") + ylab("Normalized Percentage") +
coord_flip()
```
\newpage
## Word 2
```{r}
w2 <- df %>% filter(w2_perc!=0)
library(ggplot2)
p<-ggplot(w2, aes(x=factor(Category, levels=c("Geography & Language",
"Race & Ethnicity",
"Otherness","Negative",
"Neutral", "Positive",
"Culture",
"Others & Unsure")),
y = w2_perc, fill=Country)) + geom_bar(stat="identity", position=position_dodge())
p + labs(title="Word 2") +
xlab("Category") + ylab("Normalized Percentage") +
coord_flip()
```
\newpage
## Word 3
```{r}
w3 <- df %>% filter(w3_perc!=0)
library(ggplot2)
p<-ggplot(w3, aes(x=factor(Category, levels=c("Geography & Language",
"Race & Ethnicity",
"Otherness","Negative",
"Neutral", "Positive",
"Culture",
"Others & Unsure")),
y = w3_perc, fill=Country)) + geom_bar(stat="identity", position=position_dodge())
p + labs(title="Word 3") +
xlab("Category") + ylab("Normalized Percentage") +
coord_flip()
```
\newpage
## Word 4
```{r}
w4 <- df %>% filter(w4_perc!=0)
library(ggplot2)
p<-ggplot(w4, aes(x=factor(Category, levels=c("Geography & Language",
"Race & Ethnicity",
"Otherness","Negative",
"Neutral", "Positive",
"Culture",
"Others & Unsure")),
y = w4_perc, fill=Country)) + geom_bar(stat="identity", position=position_dodge())
p + labs(title="Word 4") +
xlab("Category") + ylab("Normalized Percentage") +
coord_flip()
```
\newpage
## Word 5
```{r}
w5 <- df %>% filter(w5_perc!=0)
library(ggplot2)
p<-ggplot(w3, aes(x=factor(Category, levels=c("Geography & Language",
"Race & Ethnicity",
"Otherness","Negative",
"Neutral", "Positive",
"Culture",
"Others & Unsure")),
y = w3_perc, fill=Country)) + geom_bar(stat="identity", position=position_dodge())
p + labs(title="Word 5") +
xlab("Category") + ylab("Normalized Percentage") +
coord_flip()
```