-
Notifications
You must be signed in to change notification settings - Fork 7
/
veinticinco.R
55 lines (43 loc) · 1.34 KB
/
veinticinco.R
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
# #30díasdegráficos día 25
# Visualización Seguridad de Contraseñas
# https://github.com/rfordatascience/tidytuesday/blob/master/data/2020/2020-01-14/readme.md
# Autora: Stephanie Orellana (@sporella)
# Cargar librerías --------------------------------------------------------
library(tidyverse)
# Cargar y procesar datos -------------------------------------------------
passwords <-
readr::read_csv(
'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-01-14/passwords.csv'
) %>%
filter(!is.na(category))
# Visualización -----------------------------------------------------------
p <- ggplot(passwords, aes(x = category, y = strength, fill = category)) +
geom_violin(trim = F) +
scale_x_discrete(
labels = function(x)
gsub("-", "\n", x)
) +
scale_fill_manual(
values = c(
"#ffa96b",
"#45bdff",
"#92f214",
"#b89cff",
"#ffe564",
"#f679c8",
"#3cf2ff",
"#84af68",
"#dcdbff",
"#c0ffdb"
)
) +
labs(
title = "Seguridad de Contraseñas Según Categoría",
subtitle = "Datos de tidytuesday.\nFuente: Knowledge is Beautiful",
y = "Seguridad",
x = "",
caption = "@sporella"
) +
theme_minimal() +
theme(legend.position = "none")
ggsave("plots/veinticinco/contraseñas.png", p, width = 7, height = 5)