---
title: "Día 12 #30díasdegráficos (Lollipop). tasa de feminicidio promedio por CCAA (ESP)"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
    source_code: embed
    theme: spacelab
    
---

```{r setup, include=FALSE}

library(tidyverse)
library(readxl)
library(viridis)
library(plotly)

library(readxl)
tasa <- read_excel("C:/Users/Usuario/Desktop/r_que_r/r_que_r/content/datasets/feminicidios.xlsx")


```


```{r}

tasa <- tasa %>%
  arrange(Casos) %>%
  mutate(CCAA = factor(CCAA, levels = CCAA))

x<-ggplot(tasa, aes(x= Casos, y= CCAA)) +
  geom_segment(aes(x= 0, xend = Casos, y = CCAA, yend = CCAA), colour= "purple", size = 1) +
  geom_text(aes(x = Casos + 0.2, y = CCAA, label= round(Casos, 1)), size = 2) +
  #scale_color_viridis_c(direction = -1) +
  geom_point(colour = "purple", size = 3) +
  labs(title = "Distribución de mujeres muertas a manos de sus parejas o ex parejas \npor Comunidad Autónoma (promedio 2016-2018)",
       subtitle = "Tasa por cada millón de mujeres mayores de 15 años",
       caption = "Consejo General del Poder Judicial. Informe sobre víctimas mortales de la violencia de género 2016-2018",
       x = NULL, 
       y = NULL, 
       fill = NULL) +
  theme_minimal() +
  theme(
        axis.text.y = element_text(hjust = 0,
                                   colour = "grey40",
                                   size = 6),
        axis.text.x=element_text(colour="grey40", 
                                 size = 6),
        plot.title=element_text(size = 11, 
                                hjust = 0),
        plot.subtitle = element_text(size = 8, 
                                     hjust = 0),
        text = element_text(size = 7),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        panel.background = element_blank())

x

```