Learn R Programming

prophet (version 0.2.1)

prophet_plot_components: Plot the components of a prophet forecast. Prints a ggplot2 with panels for trend, weekly and yearly seasonalities if present, and holidays if present.

Description

Plot the components of a prophet forecast. Prints a ggplot2 with panels for trend, weekly and yearly seasonalities if present, and holidays if present.

Usage

prophet_plot_components(m, fcst, uncertainty = TRUE, plot_cap = TRUE,
  weekly_start = 0, yearly_start = 0)

Arguments

m

Prophet object.

fcst

Data frame returned by predict(m, df).

uncertainty

Boolean indicating if the uncertainty interval should be plotted for the trend, from fcst columns trend_lower and trend_upper.

plot_cap

Boolean indicating if the capacity should be shown in the figure, if available.

weekly_start

Integer specifying the start day of the weekly seasonality plot. 0 (default) starts the week on Sunday. 1 shifts by 1 day to Monday, and so on.

yearly_start

Integer specifying the start day of the yearly seasonality plot. 0 (default) starts the year on Jan 1. 1 shifts by 1 day to Jan 2, and so on.

Value

Invisibly return a list containing the plotted ggplot objects