Skip to contents

This function creates a facet plot to visualize ENSO and IOD data over time, with separate panels for each variable (IOD, ENSO3, ENSO34, ENSO4). A horizontal line at zero is included to indicate the neutral value, and a vertical line marks the current date, with the date displayed vertically on the left side of the line.

Usage

plot_ENSO_data(PATHS, frequency)

Arguments

PATHS

A list containing paths where ENSO and IOD data are stored and where output figures should be saved. Typically generated by the get_paths() function and should include:

  • DATA_ENSO: Path to the directory containing the compiled ENSO and IOD data.

  • DOCS_FIGURES: Path to the directory where the output figure will be saved.

frequency

Character; temporal resolution of the ENSO/IOD series to plot. One of "daily", "weekly", or "monthly".

Value

A ggplot facet plot showing the time series of IOD, ENSO3, ENSO34, and ENSO4 over time. The plot includes:

  • A horizontal solid line at zero to indicate the neutral sea surface temperature anomaly.

  • A vertical dashed line to indicate the current date, with the current date displayed as vertical text.

  • Facets for each variable, allowing for easy comparison of IOD and ENSO regions.

Details

This function uses ggplot2 to create a line plot with facets for each variable (IOD, ENSO3, ENSO34, and ENSO4). It adds a horizontal reference line at zero and a vertical line representing the current date. The current date is displayed as vertical text aligned to the left of the vertical line. The data is expected to be in a date, variable, and value format.

Examples

if (FALSE) { # \dontrun{
# Load the ENSO and IOD data and plot it
PATHS <- get_paths()
plot_ENSO_data(PATHS)
} # }