plot_sf_weekly_single: Plot factors by week for a range of weeks

View source: R/plot_sf_weekly_single.r

plot_sf_weekly_singleR Documentation

Plot factors by week for a range of weeks

Description

Generate a single plot of seasonal factors by week for a range of weeks

Usage

plot_sf_weekly_single(
  this_sf,
  this_week,
  first_week,
  last_week,
  forecast = 0,
  this_range = NULL,
  this_trans = TRUE
)

Arguments

this_sf

Numeric vector of seasonal factors.

this_week

Numeric vector; Week of the year to match.

first_week

Numeric scalar; First week to be included in the plot.

last_week

Numeric scalar; Last week to be included in the plot.

forecast

Numeric scalar; Number of forecasts. Default: 0.

this_range

Numeric scalar; Range of the seasonal factors to be plotted. Default: range taken from the observations being plotted.

this_trans

Logical scalar; set to TRUE if the log transformation is used in the decomposition, FALSE otherwise. Default: TRUE

Value

Generate a plot of seasonal factors by week. User can specify limits for the weeks plotted in order to generate a multi-panel plot.

Examples

par(mfrow = c(3, 2), mar = c(3.1, 2.1, 0.5, 0.5), oma = c(0, 0, 3, 0))
sf_range <- range(ic_sf)
plot_sf_weekly_single(ic_sf, this_week = ic_week,  
                      first_week = 1,  last_week = 9,   
                      forecast = 0, this_range = sf_range,    
                      this_trans = FALSE)
plot_sf_weekly_single(ic_sf, this_week = ic_week, 
                      first_week = 10, last_week = 18,   
                      forecast = 0, this_range = sf_range,    
                      this_trans = FALSE)
plot_sf_weekly_single(ic_sf, this_week = ic_week, 
                      first_week = 19, last_week = 27,   
                      forecast = 0, this_range = sf_range,    
                      this_trans = FALSE)
plot_sf_weekly_single(ic_sf, this_week = ic_week, 
                      first_week = 28, last_week = 36,   
                      forecast = 0, this_range = sf_range,    
                      this_trans = FALSE)
plot_sf_weekly_single(ic_sf, this_week = ic_week, 
                      first_week = 37, last_week = 45,   
                      forecast = 0, this_range = sf_range,    
                      this_trans = FALSE)
plot_sf_weekly_single(ic_sf, this_week = ic_week, 
                      first_week = 46, last_week = 53,   
                      forecast = 0, this_range = sf_range,    
                      this_trans = FALSE)

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