You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
labs(x = "Date", y = "SARS cases in Canada", fill = "Type")
166
168
```
167
169
168
-
*todo: include another example here*
170
+
Also from the [outbreaks](https://github.com/reconverse/outbreaks) package, we use the function `as_epi_df` on confirmed cases of ebola in Sierra Leone in 2014.
171
+
172
+
```{r,message=FALSE}
173
+
x = outbreaks::ebola_sierraleone_2014 %>%
174
+
mutate(
175
+
cases=ifelse(status=='confirmed',1,0),
176
+
province = case_when(
177
+
district %in% c('Kailahun','Kenema','Kono') ~ "Eastern",
178
+
district %in% c('Bombali','Kambia','Koinadugu',
179
+
'Port Loko','Tonkolili') ~ 'Northern',
180
+
district %in% c('Bo','Bonthe','Moyamba','Pujehun') ~ 'Sourthern',
181
+
district %in% c('Western Rural','Western Urban') ~ 'Western')) %>%
182
+
select(geo_value=province,
183
+
time_value = date_of_onset,
184
+
cases) %>% filter(cases==1) %>%
185
+
group_by(geo_value,time_value) %>%
186
+
summarise(cases=sum(cases)) %>%
187
+
as_epi_df(geo_type='province')
188
+
189
+
ggplot(x, aes(x = time_value, y = cases,fill=geo_value)) +
0 commit comments