Learn R Programming

GACE (version 1.0.0)

plot_gace: Plot GACE Forecast

Description

Produces a plot of historical and forecast values returned by gace_forecast(). Includes stability handling for missing values, non-numeric periods, and clean ggplot2 output.

Usage

plot_gace(fc)

Value

A ggplot2 object.

Arguments

fc

A data frame returned by gace_forecast(), containing:

  • period – numeric or convertible index,

  • value – observed or forecast values,

  • type – "historical" or "forecast".

Examples

Run this code
# \donttest{
  set.seed(1)
  y <- ts(rnorm(48, mean = 100, sd = 10), frequency = 12)
  fc <- gace_forecast(y, periods = 6, freq = "month")
  plot_gace(fc)
# }

Run the code above in your browser using DataLab