plot_forecast: plot_forecast

Description Usage Arguments Value

View source: R/fct_model.R

Description

A function that takes a data frame and returns the plot of the selected forecast for the selected column of data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_forecast(
  df,
  dep_var,
  ind_var = NULL,
  start,
  end,
  forecast_type,
  proj_data = NULL,
  diff_inv = FALSE,
  diff_starting_values = NULL
)

Arguments

df

data frame of data

dep_var

string - name of dependent variable to forecast

ind_var

string - vector of names of indepedent variables to use in forecast

start

vector - start year and quarter in format c(YYYY, Q)

end

vector - end year and quarter in format c(YYYY, Q)

proj_data

data frame (default NULL) of projected data to use if producing a linear regression forecast.

diff_inv

boolean (default FALSE) - if data is differenced and you want to undo this to compare to the original dataset set to TRUE

diff_starting_values

numeric (default NULL) - if data is differenced, where to start adding differences.

forecast_types

- vector of string values giving forecast types to use. One of: "holtwinters", "naive", "decomposition", "linear".

Value

plotly line graph of forecast


saralsmith/SHIFT documentation built on Feb. 7, 2021, 5:48 p.m.