Commit d8c0d712 authored by numeroteca's avatar numeroteca

fix daily cases charts in CCAA dashboard

parent df149cc9
......@@ -830,7 +830,8 @@ dev.off()
# PCR+------
png(filename=paste("img/spain/ccaa/covid19_casos-PCR-por-dia-ccaa-media-superpuesto-lineal_media.png", sep = ""),width = 1200,height = 800)
data_cases_sp_provinces %>% mutate(
daily_cases_PCR_avg7 = ifelse( province =="Galicia" | province =="Andalucía" | province =="Aragón" | province =="País Vasco" | province =="C. Valenciana", daily_cases_avg7, daily_cases_PCR_avg7)
daily_cases_PCR_avg7 = ifelse( province =="Galicia" | province =="Andalucía" | province =="Aragón" | province =="País Vasco" |
province =="C. Valenciana", daily_cases_avg7, daily_cases_PCR_avg7)
) %>%
ggplot() +
# geom_smooth(aes(date, daily_cases_avg7,group=ccaa, color=ccaa), size= 1, se = FALSE, span = 0.6 ) +
......
......@@ -250,10 +250,10 @@ Row {.tabset .tabset-fade}
### Casos / día
```{r}
interactive_dp <- data_cases_sp_provinces %>%
mutate(
daily_cases_PCR_avg7 = ifelse( date > as.Date("2020-10-02") & is.na(daily_cases_PCR_avg7), daily_cases_avg7, daily_cases_PCR_avg7 )
) %>% filter( !(is.na(daily_cases_PCR_avg7) & date > as.Date("2020-08-10") ) ) %>%
interactive_dp <- data_cases_sp_provinces %>% mutate(
daily_cases_PCR_avg7 = ifelse( province =="Galicia" | province =="Andalucía" | province =="Aragón" | province =="País Vasco" |
province =="C. Valenciana", daily_cases_avg7, daily_cases_PCR_avg7)
) %>%
ggplot() +
geom_line(aes(date, daily_cases_PCR_avg7, group = province, color=ccaa,
text = paste0("<b>", province, " (", ccaa, ")</b><br>", format( round(daily_cases_PCR_avg7, digits = 1),
......@@ -383,9 +383,10 @@ Se usan casos PCR+, menos las CCAA que empezaron a usar test de antígenos a par
### Casos / día Log
```{r}
interactive_dp <- data_cases_sp_provinces %>% mutate(
daily_cases_PCR_avg7 = ifelse( date > as.Date("2020-10-02") & is.na(daily_cases_PCR_avg7), daily_cases_avg7, daily_cases_PCR_avg7 )
) %>% filter( !(is.na(daily_cases_PCR_avg7) & date > as.Date("2020-08-10") ) ) %>%
interactive_dp <- data_cases_sp_provinces %>% mutate(
daily_cases_PCR_avg7 = ifelse( province =="Galicia" | province =="Andalucía" | province =="Aragón" | province =="País Vasco" |
province =="C. Valenciana", daily_cases_avg7, daily_cases_PCR_avg7)
) %>%
ggplot() +
geom_line(aes(date, daily_cases_PCR_avg7, group = province, color=ccaa,
text = paste0("<b>", province, " (", ccaa, ")</b><br>", format( round(daily_cases_PCR_avg7, digits = 1),
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment