-
Notifications
You must be signed in to change notification settings - Fork 2
/
01-epi_descriptiva.Rmd
52 lines (43 loc) · 1.05 KB
/
01-epi_descriptiva.Rmd
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
---
title: "reporte descriptivo"
output:
html_document:
toc: true
toc_float: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.align = "center")
```
```{r,echo=FALSE,warning=FALSE,message=FALSE}
library(tidyverse)
library(lubridate)
library(compareGroups)
```
# distribución en tiempo
```{r}
casos_limpio <- read_rds("data/casoslimpio_20190916.rds")
casos_limpio %>%
ggplot(aes(date_of_onset)) +
geom_histogram(binwidth = 7,color="white") +
scale_x_date(date_breaks = "7 day",date_labels = "%b-%d") +
theme_bw() +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
```
# distribución en espacio
```{r}
casos_limpio %>%
ggplot(aes(x = lon,y = lat,colour=date_of_onset)) +
geom_point() +
scale_color_gradient(low = "red",high = "yellow",trans = "date") +
theme_bw()
```
# tabla descriptiva
```{r}
casos_limpio %>%
mutate(hospital=fct_infreq(hospital),
outcome=fct_infreq(outcome)) %>%
select(outcome:hospital) %>%
compareGroups(~.,data = .) %>%
createTable() %>%
export2md()
```