-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
w23_pride.Rmd
executable file
·131 lines (105 loc) · 4.1 KB
/
w23_pride.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
---
title: "#TidyTuesday 2022 week23: Data for Progress’ Pride Corporate Accountability Project"
author: Federica Gazzelloni
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Data for Progress’ Pride Corporate Accountability
```{r lib, message=FALSE, warning=FALSE, paged.print=FALSE}
library(tidyverse)
```
### Fortune500
```{r data}
# pride_aggregates <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-06-07/pride_aggregates.csv')
fortune_aggregates <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-06-07/fortune_aggregates.csv')
#static_list <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-06-07/static_list.csv')
#pride_sponsors <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-06-07/pride_sponsors.csv')
#corp_by_politicians <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-06-07/corp_by_politicians.csv')
#donors <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-06-07/donors.csv')
```
```{r}
fortune_aggregates %>% names
```
```{r}
names(fortune_aggregates)<-c("company","tot_contr","n_politicians","n_states")
```
```{r}
fortune_aggregates%>%head
```
```{r}
library(extrafont)
# loadfonts()
```
```{r}
library(ggtext)
id=c("1","2","3","4","5","6","7")
plot <- fortune_aggregates%>%
arrange(-tot_contr) %>%
filter(!company=="Grand Total" # tot_contr>=50000
) %>%
slice_max(tot_contr,n=7)%>%
mutate(company=reorder(as.factor(company),tot_contr)) %>%
ggplot(aes(x=company, y=tot_contr)) +
geomtextpath::geom_textsegment(aes(xend=company,y=1,yend=tot_contr,
label=company),
family="Public Sans Medium",
textcolour=rainbow(7),
size=7,linewidth=7,
lineend = "butt",linecolour=rainbow(7)) +
geom_point( color=rainbow(7), size=7) +
geom_point( color=rainbow(7), size=12,shape=21,stroke=2) +
geom_point(shape=id,color="black", size=7) +
coord_flip()+
labs(title="Top 7 <span style='color:gold'>Anti-LGBTQ</span>",
subtitle="contributors by Fortune500",
caption="Viz:@fgazzelloni | DataSource: #TidyTuesday 2022 week23 -<span style='color:#4b2d8f'>Data for Progress’ Pride Corporate Accountability</span>")+
xlab("") +
ylab("")+
theme_light() +
theme(text = element_text(color="grey80",size=25,family="Public Sans Medium"),
plot.title = element_markdown(size=45),
plot.caption = element_markdown(size=12,hjust=0),
plot.subtitle = element_text(hjust=0),
panel.grid.major.x = element_blank(),
panel.border = element_blank(),
axis.ticks.x = element_blank(),
axis.ticks.y = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_blank(),
axis.title = element_blank(),
panel.grid = element_blank(),
plot.background = element_rect(fill="black",color="black"),
panel.background = element_rect(fill="black",color="black")
)
```
```{r}
library(cowplot)
ggdraw()+
draw_plot(plot)+
draw_label("Data for Progress",
x=0.7,
y=0.35,
size=60,
alpha = 0.2,
fontfamily = "Public Sans Medium",
color = "white")+
draw_label("F500",
x=0.5,
y=0.45,
size=350,
alpha = 0.2,
fontfamily = "Public Sans Medium",
color = "white")+
draw_label("Data for Progress has compiled a set of resources for\nactivists, employees, community leaders, and lawmakers\nto push back on these policies and the prejudice powering them.",
x=0.7,
y=0.25,
size=15,
fontfamily = "Public Sans Medium",
color = "grey90")
ggsave("w23_pride.png",
dpi=320,
width = 12,
height = 7)
```