plot.daily_output: Plot method for daily dendrometer statistics

View source: R/plot.daily_output.R

plot.daily_outputR Documentation

Plot method for daily dendrometer statistics

Description

Unified S3 plotting method for objects returned by daily.data(). Missing grouping labels are removed before grouped boxplots are drawn so NA does not appear on the x-axis.

Usage

## S3 method for class 'daily_output'
plot(
  x,
  y = NULL,
  Year = NULL,
  DOY = NULL,
  type = c("summary", "amplitude", "minmax_ribbon", "timing", "timing_violin", "lag",
    "change", "boxplot", "heatmap"),
  stat = c("amplitude", "Max_diff", "mean", "median", "Max", "Min", "lag_h",
    "Time_min_h", "Time_max_h"),
  by = c("month", "month_of_year", "year"),
  box_style = c("boxplot", "violin", "both"),
  status_cols = c(growing = "forestgreen", shrinking = "firebrick", stable = "grey60"),
  timing_segment_cols = c(`max after min` = "grey65", `max before/equal min` = "black"),
  ...
)

Arguments

x

Object of class "daily_output".

y

Unused.

Year

Optional numeric year or vector of years for subsetting.

DOY

Optional numeric vector of length 2 giving the start and end day-of-year for subsetting.

type

Plot type. One of "summary", "amplitude", "minmax_ribbon", "timing", "timing_violin", "lag", "change", "boxplot", or "heatmap".

stat

Statistic used for type = "boxplot" or type = "heatmap". One of "amplitude", "Max_diff", "mean", "median", "Max", "Min", "lag_h", "Time_min_h", "Time_max_h".

by

Grouping for type = "boxplot": "month", "month_of_year", or "year". "month" uses a continuous calendar-date axis spanning the selected data window and supports multi-year plotting, for example 2022–2024. Empty calendar months may appear as gaps, but months with available data are not clipped at the start or end of the axis.

box_style

Style for type = "boxplot": "boxplot", "violin", or "both".

status_cols

Colors for Day_status.

timing_segment_cols

Named vector of two colors for the timing connector: one for "max after min" and one for "max before/equal min".

...

Unused.

Details

Plot types:

  • "summary": daily Min, mean, median, and Max.

  • "amplitude": daily amplitude through time.

  • "minmax_ribbon": ribbon between daily Min and Max.

  • "timing": per-day line connecting daily minimum and maximum timing.

  • "timing_violin": violin distribution of Time_min_h and Time_max_h for the selected window.

  • "lag": signed lag between daily maximum and minimum time.

  • "change": day-to-day change in daily maximum Max_diff.

  • "boxplot": grouped distributions of a chosen daily statistic. For by = "month", monthly groups are plotted on a continuous date axis. The axis limits are extended beyond the first and last plotted month so edge months are not clipped.

  • "heatmap": year x day-of-year heatmap of a chosen daily statistic.

For type = "timing", the red and blue points are not connected across days. Instead, each day has its own segment connecting minimum and maximum time.

Value

A ggplot2 object, returned invisibly.

Examples


data(nepa17)
dd <- daily.data(df = nepa17[1:1000, ], TreeNum = 1)

plot(dd)
plot(dd, type = "timing")
plot(dd, type = "timing", Year = 2017, DOY = c(1, 6))
plot(dd, type = "timing_violin", Year = 2017, DOY = c(1, 6))
plot(dd, type = "boxplot", stat = "amplitude", by = "month")
plot(dd, type = "boxplot", stat = "amplitude", by = "month_of_year",
     box_style = "both")
plot(dd, type = "change")



dendRoAnalyst documentation built on May 20, 2026, 5:07 p.m.