-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGráfico interactivo Plotly coRona-Ladies.R
48 lines (40 loc) · 1.34 KB
/
Gráfico interactivo Plotly coRona-Ladies.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
################################
# #
# COVID-19 con R #
# #
################################
# Activar librerías
library(plotly)
###################### GRÁFICO INTERACTIVO #####################
# Casos
g1 <- ggplot(covid_casos, aes(x = fecha, y = total, color = CCAA, label = CCAA)) +
geom_point() +
geom_line(aes(group = CCAA)) +
theme(axis.text.x = element_text(angle = 45))
ggplotly(g1)
# Fallecidos
g2 <- ggplot(covid_fallecidos, aes(x = fecha, y = total, color = CCAA, label = CCAA)) +
geom_point() +
geom_line(aes(group = CCAA)) +
theme(axis.text.x = element_text(angle = 45))
)
ggplotly(g2)
# Ingresos en UCI
g3 <- ggplot(covid_uci, aes(x = fecha, y = total, color = CCAA, label = CCAA)) +
geom_point() +
geom_line(aes(group = CCAA)) +
theme(axis.text.x = element_text(angle = 45))
)
ggplotly(g3)
# Número de altas
g4 <- ggplot(covid_altas, aes(x = fecha, y = total, color = CCAA, label = CCAA)) +
geom_point() +
geom_line(aes(group = CCAA)) +
theme(axis.text.x = element_text(angle = 45))
ggplotly(g4)
# Pacientes hospitalizados
g5 <- ggplot(covid_hospitalizados, aes(x = fecha, y = total, color = CCAA, label = CCAA)) +
geom_point() +
geom_line(aes(group = CCAA)) +
theme(axis.text.x = element_text(angle = 45))
ggplotly(g5)