-
Notifications
You must be signed in to change notification settings - Fork 1
/
gating.Rmd
61 lines (51 loc) · 1.07 KB
/
gating.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
52
53
54
55
56
57
58
59
60
---
title: "gating"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r message = FALSE}
library(dplyr)
library(ggplot2)
library(tidyr)
library(readr)
library(stringr)
library(lubridate)
```
```{r}
wi <- read_csv("data/COVID-19_Historical_Data_Table_state.csv")
coltypes <- str_c(str_sub(sapply(wi, class), 1, 1), collapse = "")
co <- read_csv("data/COVID-19_Historical_Data_Table_county.csv",
col_types = coltypes)
#cen <- read_csv("data/COVID-19_Historical_Data_Table_census.csv",
# col_types = coltypes, na = c("", "NA", "TRACT N/A"))
wi <- wi %>%
mutate(DATE = as_date(DATE))
```
```{r}
wi_race <- wi %>%
select(DATE, DTH_AIAN:DTH_UNK) %>%
pivot_longer(DTH_AIAN:DTH_UNK, names_to = "race", values_to = "count")
```
```{r}
ggplot(wi) +
aes(DATE, POSITIVE) +
geom_line()
```
```{r}
ggplot(wi_race) +
aes(DATE, count, col = race) +
geom_line() +
scale_y_log10()
```
```{r}
ggplot(wi) +
aes(DATE, HOSP_YES) +
geom_line()
```
```{r}
ggplot(wi) +
aes(DATE, DEATHS) +
geom_line()
```