From 3548546b65ab19efec372268a89983f5c27df53f Mon Sep 17 00:00:00 2001 From: "David J. Harris" Date: Sun, 12 Mar 2017 11:51:08 -0400 Subject: [PATCH] invisibly return component plots (#11) This will make it easier for users to change the theme or other aspects of the plots, and shouldn't affect any existing behavior because the returned object is invisible. --- R/R/prophet.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/R/prophet.R b/R/R/prophet.R index fc8f556..171bd79 100644 --- a/R/R/prophet.R +++ b/R/R/prophet.R @@ -919,6 +919,8 @@ plot.prophet <- function(x, fcst, uncertainty = TRUE, xlabel = 'ds', #' @param uncertainty Boolean indicating if the uncertainty interval should be #' plotted for the trend, from fcst columns trend_lower and trend_upper. #' +#' @return Invisibly return a list containing the plotted ggplot objects +#' #' @export #' @importFrom dplyr "%>%" prophet_plot_components <- function(m, fcst, uncertainty = TRUE) { @@ -945,6 +947,7 @@ prophet_plot_components <- function(m, fcst, uncertainty = TRUE) { print(panels[[i]], vp = grid::viewport(layout.pos.row = i, layout.pos.col = 1)) } + return(invisible(panels)) } #' Plot the prophet trend.