plot_temperature_at_depth: Plot temperature coloured by depth

View source: R/plot_temperature_at_depth.R

plot_temperature_at_depthR Documentation

Plot temperature coloured by depth

Description

Plot temperature coloured by depth

Usage

plot_temperature_at_depth(
  dat,
  trend_threshold = 4,
  superchill_threshold = -0.7,
  heat_threshold = 18,
  facet_var = NULL,
  colour_palette = NULL,
  legend_drop = FALSE,
  legend_position = "right",
  date_breaks_major = NULL,
  date_breaks_minor = NULL,
  date_labels_format = NULL,
  ncol = 1,
  nrow = NULL,
  alpha = 1,
  plotly_friendly = FALSE
)

Arguments

dat

Data frame with at least three columns: TIMESTAMP (must be possible to convert to POSIXct), DEPTH, and VALUE. If column VARIABLE is included, it must have one unique entry. May also include columns with grouping variables passed to .... Other columns will be ignored.

trend_threshold

The threshold for "trending up". Default is trend_threshold = 4. The last observation above trend_threshold that does not return below trend_threshold triggers the beginning of the growing season for each DEPTH and group in ....

superchill_threshold

The threshold for "superchill". Default is superchill_threshold = -0.7. The first observation below superchill_threshold triggers the end of the growing season for each group in DEPTH and ....

heat_threshold

The threshold for heat stress. Default is heat_threshold = 18). Every observation above heat_threshold triggers an n-hour heat stress interval.

facet_var

Variable(s) defining faceting groups. Variables must be column(s) in dat). For a single facet variable: facet_var = "SEASON". For more than one facet variables: facet_var = "SEASON + DEPTH". Default is facet_var = NULL.

colour_palette

Optional vector of hex colors onto which DEPTH will be mapped. If colour_palette = NULL (the default), the reverse viridis colour palette will be used (option D).

legend_drop

Logical argument indicating whether to drop unused depths from the legend. Default is legend_drop = FALSE

legend_position

Position of the legend ("none", "left", "right", "bottom", "top"). Default is legend_position = "right".

date_breaks_major

Character string specifying intervals for major breaks on the x-axis, e.g., date_breaks_major = "2 month". Default is date_breaks_major = NULL, which chooses breaks based on the length of the data series.

date_breaks_minor

Character string specifying intervals for major breaks on the x-axis, e.g., date_breaks_minor = "1 month". Default is date_breaks_minor = NULL, which chooses breaks based on the length of the data series.

date_labels_format

Character string specifying the format of the date labels on the x-axis, e.g., date_labels_format = "%y-%b". Default is date_labels_format = NULL, which chooses labels based on the length of the data series.

ncol

Number of columns for faceted figure. Default is ncol = 1.

nrow

Number of rows for faceted figure. Default is nrow = NULL.

alpha

Transparency for the heat stress and superchill shaded boxes.

plotly_friendly

Logical argument. If TRUE, y-axis label is set to a plotly-friendly title ("Temperature (deg C)"). If FALSE, expression() is used to insert the degree symbol.

Value

ggplot object


dempsey-CMAR/tgc documentation built on Oct. 20, 2023, 6:45 p.m.