plot.SC_output: Plotting output of stem cycle approach

View source: R/plot.SC_output.R

plot.SC_outputR Documentation

Plotting output of stem cycle approach

Description

S3 plot method for output from phase.sc(). The function supports old SC_phase tables (TIME, dm, Phases) and newer tables with tree-level information (Tree, TIME, dm, Phases).

Usage

## S3 method for class 'SC_output'
plot(
  x,
  DOY = NULL,
  Year = NULL,
  type = c("points", "ribbon", "both", "shrinkage", "expansion", "increment", "boxplot"),
  cols = c("#fee8c8", "#fdbb84", "#e34a33"),
  phNames = c("Shrinkage", "Expansion", "Increment"),
  point_size = 3,
  ribbon_alpha = 0.35,
  show_tree = TRUE,
  stat = "Magnitude",
  temporal = "raw",
  phase = "all",
  ...
)

Arguments

x

An object of class "SC_output", returned by phase.sc().

DOY

Numeric vector with initial and final day of year for plotting, e.g. c(50, 60). If NULL, the full available period is plotted.

Year

Numeric value indicating the calendar year for plotting. Required when DOY is supplied.

type

Character. Plot type, including boxplot for cycle distributions. One of "points", "ribbon", "both", "shrinkage", "expansion", or "increment".

cols

Character vector of three colours, one for each phase.

phNames

Character vector with three phase names.

point_size

Numeric point size used for phase points.

ribbon_alpha

Numeric transparency for phase ribbons.

show_tree

Logical. If TRUE, tree information is shown in the plot subtitle when available.

stat

Numeric cycle column for boxplots; in ZG, an alias for metric.

temporal

Calendar grouping for boxplots: raw, daily, weekly, monthly or yearly.

phase

Phase names to include in boxplots, or all.

...

Unsupported arguments raise an error.

Details

For type = boxplot, each cycle/event contributes one observation. Calendar groups use event start dates, retain the year, and do not aggregate values before calculating quartiles. Non-finite measurements are excluded.

Value

A ggplot object.

Examples

library(dendRoAnalyst)
data(gf_nepa17)
sc.phase <- phase.sc(df = gf_nepa17, TreeNum = 1, smoothing = 12)
plot(sc.phase, DOY = c(50, 60), Year = 2017)
plot(sc.phase, DOY = c(50, 60), Year = 2017, type = "ribbon")
plot(sc.phase, DOY = c(50, 60), Year = 2017, type = "increment")


dendRoAnalyst documentation built on Oct. 2, 2026, 9:06 a.m.