@@ -31,7 +31,8 @@ bundle_files <- list( '../epic/standard/weekly.csv.gz',
3131 ' ../wastewater/standard/data.csv.gz' ,
3232 ' ../delphi_doctors_claims/standard/data.csv.gz' ,
3333 ' ../delphi_hospital_claims/standard/data.csv.gz' ,
34- ' ../delphi_nhsn/standard/data.csv.gz'
34+ ' ../delphi_nhsn/standard/data.csv.gz' ,
35+ ' ../delphi_ili_fluview/standard/data.csv.gz'
3536)
3637
3738start_time <- " 2020"
@@ -60,43 +61,6 @@ combined <- Reduce(
6061# colnames(combined) <- sub("n_", "epic_", colnames(combined), fixed = TRUE)
6162
6263
63-
64- # ###########################
65- # ###########################
66- # Experimental: try to just create one big output table
67- # output_table <- combined %>%
68- # pivot_longer(
69- # cols = where(is.numeric),
70- # names_to = "metric",
71- # values_to = "value"
72- # ) %>%
73- # arrange(geography, metric, time) %>%
74- # group_by(geography, metric) %>%
75- # mutate(
76- # value_smooth = zoo::rollapplyr(value, 3, mean, partial = TRUE, na.rm = TRUE),
77- # value_smooth_scale = value_smooth / max(value_smooth, na.rm = TRUE) * 100
78- # ) %>%
79- # ungroup() %>%
80- # pivot_wider(
81- # names_from = metric,
82- # values_from = c(value, value_smooth, value_smooth_scale),
83- # names_sep = "_"
84- # )
85- # vroom::vroom_write(
86- # output_table,
87- # "dist/TEST_mega.csv.gz",
88- # ","
89- # )
90- # arrow::write_parquet(output_table,
91- # "dist/TEST_mega.parquet")
92- #
93- # jsonlite::write_json(output_table, gzfile("dist/TEST_mega.json.gz"), dataframe = "columns") #way too big
94-
95- # ###################################
96- # ###################################
97- # ###################################
98-
99-
10064overall_trends <- combined %> %
10165 filter( (time > = max(time ) - 365 * 2 ) & geography %in% state_fips ) %> %
10266 rename(fips = geography ) %> %
@@ -175,7 +139,7 @@ overall_trends %>%
175139
176140overall_trends %> %
177141 filter(grepl(' flu' ,variable ) & ! is.na(value )) %> %
178- filter(variable %in% c(' epic_pct_flu' , ' percent_visits_flu' , ' rate_flu' ,' wastewater_flua' ,' delphi_nhsn_flu' ,' delphi_hospital_flu_smooth' )) %> %
142+ filter(variable %in% c(' epic_pct_flu' , ' percent_visits_flu' , ' rate_flu' ,' wastewater_flua' ,' delphi_nhsn_flu' ,' delphi_hospital_flu_smooth' , ' delphi_fluview_wili ' )) %> %
179143 mutate( source = if_else(variable == ' epic_pct_flu' , ' Epic Cosmos, ED' ,
180144 if_else(variable == ' percent_visits_flu' , ' CDC NSSP' ,
181145 if_else(variable == ' rate_flu' , ' CDC RespNET' ,
0 commit comments