From 4a12ad674a80daf1b06537bea5403b19870e8494 Mon Sep 17 00:00:00 2001 From: mitokic Date: Tue, 22 Oct 2024 11:54:50 -0700 Subject: [PATCH] bug fix with missing data in drivers with future values --- R/hierarchy.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/hierarchy.R b/R/hierarchy.R index 544d802d..da7cda2e 100644 --- a/R/hierarchy.R +++ b/R/hierarchy.R @@ -112,6 +112,7 @@ prep_hierarchical_data <- function(input_data, .noexport = NULL ) %do% { temp_tbl <- input_data_adj %>% + tidyr::drop_na(tidyselect::all_of(regressor_var)) %>% dplyr::select(Date, tidyselect::all_of(value_level_iter), tidyselect::all_of(regressor_var)) %>% dplyr::distinct() @@ -144,6 +145,7 @@ prep_hierarchical_data <- function(input_data, # agg by total total_tbl <- input_data_adj %>% + tidyr::drop_na(tidyselect::all_of(regressor_var)) %>% dplyr::select(Date, value_level[[1]], tidyselect::all_of(regressor_var)) %>% dplyr::distinct() %>% dplyr::group_by(Date) %>%