plot_baselines: Plot Baseline forecasts

Description Usage Arguments Value Examples

View source: R/plot_baselines.R

Description

Plot results of baselines (by ggplot2)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
plot_baselines(
  data,
  col_date = "index",
  col_value = "value",
  col_group = "type",
  title = NULL,
  size = 0.6,
  alpha = 0.8,
  colors = NULL,
  legend = "bottom",
  scale = NULL
)

Arguments

data

data.frame containing "Date", "value" and "group"

col_date

Date column in data, default to "index"

col_value

Value column in data, default to "value"

col_group

Group column in data, default to "type" (e.g. "Actual", "Naive", ...) - see example

title

diagram title

size

line size

alpha

line alpha value

colors

named character vector to fit color to type

legend

legend position

scale

NULL or two Date values to scale x-axis

Value

ggplot2 object

Examples

1
2
3
4
plot_baselines(
  data = tsRNN::fc_baseline,
  colors = c("Actual" = "black", "Snaive" = "blue", "Holt" = "green")
)

thfuchs/tsRNN documentation built on April 17, 2021, 11:03 p.m.