@@ -4,6 +4,9 @@ date: "Rendered: `r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`"
4
4
output :
5
5
html_document :
6
6
code_folding : hide
7
+ toc : True
8
+ # self_contained: False
9
+ # lib_dir: libs
7
10
editor_options :
8
11
chunk_output_type : console
9
12
---
@@ -40,7 +43,7 @@ if (wday(Sys.Date()) < 6 & wday(Sys.Date()) > 3) {
40
43
most_recent_result %<>% process_nhsn_data()
41
44
df <- most_recent_result %>%
42
45
filter(disease == "nhsn_flu")
43
- df %>%
46
+ p <- df %>%
44
47
filter(geo_value %in% c("ca", "fl", "tx", "ny", "pa", "mn", "nm")) %>%
45
48
ggplot(aes(x = time_value, y = value, color = geo_value)) +
46
49
geom_line() +
@@ -51,14 +54,15 @@ df %>%
51
54
y = "Total Confirmed Flu Admissions"
52
55
) +
53
56
theme(axis.text.x = element_text(angle = 90, hjust = 1))
57
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
54
58
```
55
59
56
60
# State Season Comparison {.tabset}
57
61
58
62
## California
59
63
60
64
``` {r}
61
- df %>%
65
+ p <- df %>%
62
66
filter(geo_value == "ca") %>%
63
67
ggplot(aes(x = season_week, y = value, color = season)) +
64
68
geom_line() +
@@ -69,12 +73,13 @@ df %>%
69
73
y = "Total Confirmed Flu Admissions"
70
74
) +
71
75
theme(axis.text.x = element_text(angle = 90, hjust = 1))
76
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
72
77
```
73
78
74
79
## Florida
75
80
76
81
``` {r}
77
- df %>%
82
+ p <- df %>%
78
83
filter(geo_value == "fl") %>%
79
84
ggplot(aes(x = season_week, y = value, color = season)) +
80
85
geom_line() +
@@ -85,12 +90,13 @@ df %>%
85
90
y = "Total Confirmed Flu Admissions"
86
91
) +
87
92
theme(axis.text.x = element_text(angle = 90, hjust = 1))
93
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
88
94
```
89
95
90
96
## Texas
91
97
92
98
``` {r}
93
- df %>%
99
+ p <- df %>%
94
100
filter(geo_value == "tx") %>%
95
101
ggplot(aes(x = season_week, y = value, color = season)) +
96
102
geom_line() +
@@ -101,12 +107,13 @@ df %>%
101
107
y = "Total Confirmed Flu Admissions"
102
108
) +
103
109
theme(axis.text.x = element_text(angle = 90, hjust = 1))
110
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
104
111
```
105
112
106
113
## New York
107
114
108
115
``` {r}
109
- df %>%
116
+ p <- df %>%
110
117
filter(geo_value == "ny") %>%
111
118
ggplot(aes(x = season_week, y = value, color = season)) +
112
119
geom_line() +
@@ -117,12 +124,13 @@ df %>%
117
124
y = "Total Confirmed Flu Admissions"
118
125
) +
119
126
theme(axis.text.x = element_text(angle = 90, hjust = 1))
127
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
120
128
```
121
129
122
130
## Pennsylvania
123
131
124
132
``` {r}
125
- df %>%
133
+ p <- df %>%
126
134
filter(geo_value == "pa") %>%
127
135
ggplot(aes(x = season_week, y = value, color = season)) +
128
136
geom_line() +
@@ -133,12 +141,13 @@ df %>%
133
141
y = "Total Confirmed Flu Admissions"
134
142
) +
135
143
theme(axis.text.x = element_text(angle = 90, hjust = 1))
144
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
136
145
```
137
146
138
147
## Minnesota
139
148
140
149
``` {r}
141
- df %>%
150
+ p <- df %>%
142
151
filter(geo_value == "mn") %>%
143
152
ggplot(aes(x = season_week, y = value, color = season)) +
144
153
geom_line() +
@@ -149,12 +158,13 @@ df %>%
149
158
y = "Total Confirmed Flu Admissions"
150
159
) +
151
160
theme(axis.text.x = element_text(angle = 90, hjust = 1))
161
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
152
162
```
153
163
154
164
## New Mexico
155
165
156
166
``` {r}
157
- df %>%
167
+ p <- df %>%
158
168
filter(geo_value == "nm") %>%
159
169
ggplot(aes(x = season_week, y = value, color = season)) +
160
170
geom_line() +
@@ -165,6 +175,7 @@ df %>%
165
175
y = "Total Confirmed Flu Admissions"
166
176
) +
167
177
theme(axis.text.x = element_text(angle = 90, hjust = 1))
178
+ ggplotly(p, tooltip = "text", height = 800, width = 1000)
168
179
```
169
180
170
181
# Comparing with Old NHSN Data
0 commit comments