weekly_high_density_plot: High density plots for weekly series

View source: R/weekly_high_density_plot.r

weekly_high_density_plotR Documentation

High density plots for weekly series

Description

Generates high density plots for weekly time series around a given mean - current supported time series objects are xts and tis

Usage

weekly_high_density_plot(
  x,
  this_start = NULL,
  this_end = NULL,
  this_main = NULL,
  this_range = NULL,
  this_ylab = " ",
  this_col = "grey",
  this_mu = 0,
  this_cex = 0.75
)

Arguments

x

numeric vector, original time series object to be plotted.

this_start

Integer array of length 2, beginning date for plot. Default is NULL (reset to starting date of series).

this_end

Integer array of length 2, ending date for plot. Default is NULL (reset to ending date of series).

this_main

Character string, Main title of plot. Default is "High Density Plot".

this_range

numeric vector of length 2, range of data displayed in plot. Default is NULL, the range of x will be used.

this_ylab

character string, label for Y-axis on plot. Default is " ", or no label.

this_col

character string, color of lines in plot. Default is "grey".

this_mu

numeric scalar, mean value that the high density plot will be plotted around. Default is 0.0

this_cex

numeric scalar, value for plotting parameter cex which controls the amount by which plotting text and symbols should be scaled relative to the default. Default is 0.75.

Value

High density plot for x

Examples

this_color <- c("#4682B4", "#7846B4", "#B47846", "#82B446")
par(mfrow = c(2,2), mar= c(2,4,4.25,1.0), oma=c(0,0,3,0))
ic_outlier_range     <- 
   range(ic_outlier, ic_outlier_auto, ic_outlier_auto_ljung, ic_outlier_tc)
weekly_high_density_plot(ic_outlier, this_start = c(2018,1), 
                         this_main = "default model", 
                         this_range = ic_outlier_range, 
                         this_ylab = "IC", this_col = this_color[1])
weekly_high_density_plot(ic_outlier_auto, this_start = c(2018,1), 
                         this_main = "auto outlier", 
                         this_range = ic_outlier_range, 
                         this_ylab = "IC", this_col = this_color[2])
weekly_high_density_plot(ic_outlier_auto_ljung, this_start = c(2018,1), 
                         this_main = "auto, ljung cv", 
                         this_range = ic_outlier_range, 
                         this_ylab = "IC", this_col = this_color[3])
weekly_high_density_plot(ic_outlier_tc, this_start = c(2018,1), 
                         this_main = "auto with tc", 
                         this_range = ic_outlier_range, 
                         this_ylab = "IC", this_col = this_color[4])
mtext("Initial Claims, outlier, from 2018", 3, 1.5, outer=TRUE)

bcmonsell/airutilities documentation built on May 16, 2022, 3:23 p.m.