Created
May 9, 2019 06:12
-
-
Save gonzalezgouveia/97ef512f89ce9ea247082fc15a5a00c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggthemes) | |
# Hecho por Rafa @GonzalezGouveia | |
# Con gusto para #DatosDeMiercoles, propuesto por @R4DS_es | |
# descargando datos | |
datos_uip <- readr::read_csv("https://raw.githubusercontent.com/cienciadedatos/datos-de-miercoles/master/datos/2019/2019-05-08/datos_uip.csv") | |
# cuantos paises tienen informacion de cuota | |
datos_uip %>% | |
filter(cuota_genero %in% c('Sí', 'No')) %>% | |
group_by(pais) %>% | |
summarise(count_n = n()) %>% | |
summarise(n(), sum(count_n)) | |
# `n()` `sum(count_n)` | |
# 189 262 | |
# grafica de boxplot | |
datos_uip %>% | |
filter(cuota_genero %in% c('Sí', 'No')) %>% | |
ggplot(aes(x = cuota_genero, | |
y = porcentaje_mujeres, | |
fill = cuota_genero)) + | |
geom_boxplot(width = 0.5) + | |
labs(title = '¿Es efectiva la cuota de género?', | |
subtitle = 'Datos de parlamentos de 189 paises', | |
x = '¿Existe cuota de género?', | |
y = 'Porcentaje de mujeres') + | |
# estilo | |
theme_gdocs() + | |
#quitando leyenda | |
theme(legend.position = 'none') | |
# guardando imagen | |
ggsave("./images/datos_de_miercoles_parlamentos.png", | |
width = 5, | |
height = 5) | |
# Hecho por Rafa @GonzalezGouveia | |
# Con gusto para #DatosDeMiercoles, propuesto por @R4DS_es |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment