Skip to content

Commit 87f0394

Browse files
committed
dock: update reports
1 parent 4f6fefd commit 87f0394

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

scripts/reports/forecast_report.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ author: Delphi Forecast Team
44
date: "Rendered: `r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`, Forecast date: `r params$forecast_date`, Last day of data: `r max(params$truth_data$target_end_date)`"
55
output:
66
html_document:
7+
code_folding: hide
78
toc: True
89
# self_contained: False
910
# lib_dir: libs

scripts/reports/new_data.Rmd

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ date: "Rendered: `r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`"
44
output:
55
html_document:
66
code_folding: hide
7+
toc: True
8+
# self_contained: False
9+
# lib_dir: libs
710
editor_options:
811
chunk_output_type: console
912
---
@@ -40,7 +43,7 @@ if (wday(Sys.Date()) < 6 & wday(Sys.Date()) > 3) {
4043
most_recent_result %<>% process_nhsn_data()
4144
df <- most_recent_result %>%
4245
filter(disease == "nhsn_flu")
43-
df %>%
46+
p <- df %>%
4447
filter(geo_value %in% c("ca", "fl", "tx", "ny", "pa", "mn", "nm")) %>%
4548
ggplot(aes(x = time_value, y = value, color = geo_value)) +
4649
geom_line() +
@@ -51,14 +54,15 @@ df %>%
5154
y = "Total Confirmed Flu Admissions"
5255
) +
5356
theme(axis.text.x = element_text(angle = 90, hjust = 1))
57+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
5458
```
5559

5660
# State Season Comparison {.tabset}
5761

5862
## California
5963

6064
```{r}
61-
df %>%
65+
p <- df %>%
6266
filter(geo_value == "ca") %>%
6367
ggplot(aes(x = season_week, y = value, color = season)) +
6468
geom_line() +
@@ -69,12 +73,13 @@ df %>%
6973
y = "Total Confirmed Flu Admissions"
7074
) +
7175
theme(axis.text.x = element_text(angle = 90, hjust = 1))
76+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
7277
```
7378

7479
## Florida
7580

7681
```{r}
77-
df %>%
82+
p <- df %>%
7883
filter(geo_value == "fl") %>%
7984
ggplot(aes(x = season_week, y = value, color = season)) +
8085
geom_line() +
@@ -85,12 +90,13 @@ df %>%
8590
y = "Total Confirmed Flu Admissions"
8691
) +
8792
theme(axis.text.x = element_text(angle = 90, hjust = 1))
93+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
8894
```
8995

9096
## Texas
9197

9298
```{r}
93-
df %>%
99+
p <- df %>%
94100
filter(geo_value == "tx") %>%
95101
ggplot(aes(x = season_week, y = value, color = season)) +
96102
geom_line() +
@@ -101,12 +107,13 @@ df %>%
101107
y = "Total Confirmed Flu Admissions"
102108
) +
103109
theme(axis.text.x = element_text(angle = 90, hjust = 1))
110+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
104111
```
105112

106113
## New York
107114

108115
```{r}
109-
df %>%
116+
p <- df %>%
110117
filter(geo_value == "ny") %>%
111118
ggplot(aes(x = season_week, y = value, color = season)) +
112119
geom_line() +
@@ -117,12 +124,13 @@ df %>%
117124
y = "Total Confirmed Flu Admissions"
118125
) +
119126
theme(axis.text.x = element_text(angle = 90, hjust = 1))
127+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
120128
```
121129

122130
## Pennsylvania
123131

124132
```{r}
125-
df %>%
133+
p <- df %>%
126134
filter(geo_value == "pa") %>%
127135
ggplot(aes(x = season_week, y = value, color = season)) +
128136
geom_line() +
@@ -133,12 +141,13 @@ df %>%
133141
y = "Total Confirmed Flu Admissions"
134142
) +
135143
theme(axis.text.x = element_text(angle = 90, hjust = 1))
144+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
136145
```
137146

138147
## Minnesota
139148

140149
```{r}
141-
df %>%
150+
p <- df %>%
142151
filter(geo_value == "mn") %>%
143152
ggplot(aes(x = season_week, y = value, color = season)) +
144153
geom_line() +
@@ -149,12 +158,13 @@ df %>%
149158
y = "Total Confirmed Flu Admissions"
150159
) +
151160
theme(axis.text.x = element_text(angle = 90, hjust = 1))
161+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
152162
```
153163

154164
## New Mexico
155165

156166
```{r}
157-
df %>%
167+
p <- df %>%
158168
filter(geo_value == "nm") %>%
159169
ggplot(aes(x = season_week, y = value, color = season)) +
160170
geom_line() +
@@ -165,6 +175,7 @@ df %>%
165175
y = "Total Confirmed Flu Admissions"
166176
) +
167177
theme(axis.text.x = element_text(angle = 90, hjust = 1))
178+
ggplotly(p, tooltip = "text", height = 800, width = 1000)
168179
```
169180

170181
# Comparing with Old NHSN Data

0 commit comments

Comments
 (0)