Learn R Programming

sectorgap (version 0.1.0)

plot_time_series: Time series plots

Description

Creates a set of time series plots of the results.

Usage

plot_time_series(
  df,
  settings = settings,
  n_col = 3,
  n_sep = 5,
  highlighted_area = NULL,
  plot_start = NULL,
  plot_end = NULL,
  file_path = NULL,
  title = TRUE,
  save = TRUE,
  device = "jpg",
  width = 10,
  height = 3,
  units = "in"
)

Value

nothing

Arguments

settings

list with model setting, in the format returned by the function initialize_settings

n_col

number of columns for grid plots

n_sep

increments of x axis ticks in years

highlighted_area

data frame with two columns called start and end containing start and end date, e.g. 1990.25 and 1992.75 for 1990 Q2 until 1992 Q4 (only used if plot_type = "timeseries")

plot_start

start of x axis in years, e.g., 1990.5 (only used if plot_type = "timeseries")

plot_end

end of x axis in years, e.g., 2010.25 (only used if plot_type = "timeseries")

file_path

file path for plots

title

boolean indicating if plots should contain titles

save

boolean indicating if plots should be saved, if FALSE, the plots will be printed instead, default is save = FALSE (ignored if file_path is provided)

device

character string with format used in ggsave

width

plot width in units, for grid plots adjusted for the number of plot columns n_col

height

plot height in units, for grid plots adjusted for the number of plot rows implied by n_col

units

units for plot size ("in", "cm", "mm", or "px")