plot_filtered_data: Plot filtered data with removed data greyed out

View source: R/plot_filtered_data.R

plot_filtered_dataR Documentation

Plot filtered data with removed data greyed out

Description

Plot filtered data with removed data greyed out

Usage

plot_filtered_data(
  dat,
  dat_filtered,
  trend_threshold = 4,
  superchill_threshold = -0.7,
  heat_threshold = 18,
  colour_palette = NULL,
  legend_drop = FALSE,
  legend_position = "right",
  ylims = NULL,
  date_axis_name = "Date",
  date_breaks_major = NULL,
  date_breaks_minor = NULL,
  date_labels_format = NULL,
  plotly_friendly = FALSE,
  alpha = 1
)

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.

dat_filtered

Filtered data, i.e. the result of apply_dd_filters(dat).

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.

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".

ylims

Numeric vector of limits for the y-axis.

date_axis_name

Name for the x-axis.

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.

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.

alpha

Transparency for the heat stress and superchill shaded boxes.

Value

Returns a ggplot object.


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