From 1c01713f8d759838759169191a1599fe50f7834c Mon Sep 17 00:00:00 2001 From: Rob Schoenbeck Date: Mon, 27 Feb 2017 13:35:29 -0800 Subject: [PATCH] issue-31-34 patch holiday forecast comp --- R/R/prophet.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/R/prophet.R b/R/R/prophet.R index 9af0836..68b9377 100644 --- a/R/R/prophet.R +++ b/R/R/prophet.R @@ -951,13 +951,13 @@ prophet_plot_components <- function(m, fcst, uncertainty = TRUE) { panels <- list(gg.trend) # Plot holiday components, if present. if (!is.null(m$holidays)) { - holiday.comps <- unique(m$holidays$holiday) + holiday.comps <- unique(m$holidays$holiday) %>% as.character() df.s <- data.frame(ds = df$ds, - holidays = rowSums(df[, holiday.comps]), + holidays = rowSums(df[, holiday.comps, drop = FALSE]), holidays_lower = rowSums(df[, paste0(holiday.comps, - "_lower")]), + "_lower"), drop = FALSE]), holidays_upper = rowSums(df[, paste0(holiday.comps, - "_upper")])) + "_upper"), drop = FALSE])) # NOTE the above CI calculation is incorrect if holidays overlap in time. # Since it is just for the visualization we will not worry about it now. gg.holidays <- ggplot2::ggplot(df.s, ggplot2::aes(x = ds, y = holidays)) +