plot_variables_at_depth: Exports ggplot2 object(s) of variables at depth over time

View source: R/plot_variables_at_depth.R

plot_variables_at_depthR Documentation

Exports ggplot2 object(s) of variables at depth over time

Description

Exports ggplot2 object(s) of variables at depth over time

Usage

plot_variables_at_depth(
  dat.tidy,
  plot.title = "",
  color.palette = NULL,
  date.breaks.major = NULL,
  date.breaks.minor = NULL,
  date.labels.format = NULL,
  standard.DO.ylims = TRUE,
  alpha.points = 1,
  legend.name = "Depth (m)",
  legend.position = "right"
)

Arguments

dat.tidy

Data in tidy format, as returned by the function convert_to_tidydata(). Must include four columns: TIMESTAMP (POSIXct), VARIABLE (character), DEPTH (ordered factor), and VALUE (numeric).

plot.title

Title for plot. Default is no title.

color.palette

Color palette of hex colors onto which DEPTH will be mapped. Required if there are more than 6 levels in DEPTH. Default is color.palette = rev(viridis(6, option = "D")).

date.breaks.major

Intervals for major breaks. Default is selected by get_xaxis_breaks().

date.breaks.minor

Intervals for minor breaks. Default is date.breaks.minor = "1 month".

date.labels.format

Format for the date labels. Default is "%y-%b" (two-digit year-three-letter month).

standard.DO.ylims

If TRUE, the y-limits for dissolved oxygen are set to c(60, 130) %. If FALSE, the y-limits are set to the ggplot default.

alpha.points

Value indicating the transparency of the points. 0 is most transparent; 1 is opaque.

legend.name

Name for the legend. Must be a character string. Default is legend.name = "Depth (m)".

legend.position

Position for the legend. Passed to ggpubr. Default is legend.position = "right".

Value

Returns ggplot2 object, a single figure with the plots for each variable in tidy.data stacked in a column is returned.

Author(s)

Danielle Dempsey

See Also

Other plot: get_colour_palette(), get_xaxis_breaks()


Centre-for-Marine-Applied-Research/strings documentation built on Aug. 21, 2023, 8 a.m.