Skip to content

Commit

Permalink
Changes To The Weekly-Summaries Data Files (#208)
Browse files Browse the repository at this point in the history
* add horizon column to map data

* alphabetical columns with United States first

* long name United States to US in forecast data file

* revert some changes

* actually revert changes...again
  • Loading branch information
AFg6K7h4fhy2 authored Dec 20, 2024
1 parent 16fdc83 commit adf3bb9
Show file tree
Hide file tree
Showing 4 changed files with 5,315 additions and 5,304 deletions.
12 changes: 11 additions & 1 deletion src/get_forecast_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' - `forecast_fullnames`: full model name
#'
#' To run:
#' Rscript get_forecast_data.R --reference_date 2024-11-23
#' Rscript get_forecast_data.R --reference_date 2024-12-21
#' --base_hub_path ../ --horizons_to_include 0 1 2


Expand Down Expand Up @@ -129,7 +129,17 @@ all_forecasts_data <- forecasttools::pivot_hubverse_quantiles_wider(
.names = "{.col}_rounded"
),
forecast_due_date = as.Date(ref_date) - 3,
location_sort_order = ifelse(location_name == "United States", 0, 1)
) |>
# long name "United States" to "US"
dplyr::mutate(
location_name = dplyr::if_else(
location_name == "United States",
"US",
location_name
)
) |>
dplyr::arrange(location_sort_order, location_name) |>
dplyr::left_join(
dplyr::distinct(
model_metadata,
Expand Down
3 changes: 2 additions & 1 deletion src/get_map_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#' as a string (Ex: "November 23, 2024")
#'
#' To run:
#' Rscript get_map_data.R --reference_date 2024-11-23
#' Rscript get_map_data.R --reference_date 2024-12-21
#' --base_hub_path ../ --horizons_to_include 0 1 2


Expand Down Expand Up @@ -228,6 +228,7 @@ map_data <- ensemble_data |>
) |>
dplyr::select(
location_name = location,
horizon,
quantile_0.025_per100k,
quantile_0.5_per100k,
quantile_0.975_per100k,
Expand Down
Loading

0 comments on commit adf3bb9

Please sign in to comment.