plot.dm_detrended: Plot detrended dendrometer series

View source: R/plot_dm.detrend.R

plot.dm_detrendedR Documentation

Plot detrended dendrometer series

Description

S3 plotting method for objects returned by [dm.detrend.fit()].

The default plot compares:

  • original daily dendrometer series,

  • fitted curve reconstructed on the original daily scale,

  • residuals ('observed - fitted_original'),

  • detrended standardized series.

Usage

## S3 method for class 'dm_detrended'
plot(
  x,
  y = NULL,
  type = c("compare", "fit", "residual", "detrended", "boxplot"),
  series = NULL,
  seasons = NULL,
  x_axis = c("default", "date", "season_day", "doy"),
  facet_by = c("series", "season", "none"),
  ncol = NULL,
  box_group = c("series", "season"),
  show_observed = TRUE,
  show_fitted = TRUE,
  point_alpha = 0.7,
  line_width = 0.8,
  legend_position = "right",
  ...
)

Arguments

x

An object of class "dm_detrended" returned by [dm.detrend.fit()].

y

Unused.

type

Plot type. One of:

'"compare"'

Default three-panel comparison of original daily vs fitted, residuals, and detrended standardized series.

'"fit"'

Original daily and fitted original-scale values only.

'"residual"'

Residuals only.

'"detrended"'

Detrended standardized series only.

'"boxplot"'

Distribution of detrended standardized values by series or season.

series

Optional character vector of dendrometer series to plot. Default is NULL, meaning all available series are used.

seasons

Optional character vector of vegetation-season labels to plot. Default is NULL, meaning all seasons are used.

x_axis

Character string controlling the x-axis. One of:

'"default"'

Uses date for '"compare"' and '"fit"', and season day for '"residual"' and '"detrended"'.

'"date"'

Use actual calendar date.

'"season_day"'

Use vegetation-season day.

'"doy"'

Use calendar day-of-year.

facet_by

Character string controlling faceting. One of:

'"series"'

Facet by dendrometer series.

'"season"'

Facet by vegetation season.

'"none"'

No faceting.

ncol

Optional integer giving the number of columns in faceted plots where [ggplot2::facet_wrap()] is used.

box_group

For type = "boxplot", grouping variable on the x-axis. One of "series" or "season".

show_observed

Logical. If TRUE, original daily observations are shown in plot types where relevant. Default is TRUE.

show_fitted

Logical. If TRUE, fitted original-scale values are shown in plot types where relevant. Default is TRUE.

point_alpha

Numeric alpha level used for observed points. Default is 0.7.

line_width

Numeric line width used for fitted, residual, and detrended lines. Default is 0.8.

legend_position

Character string specifying legend position. Default is "right".

...

Further arguments passed to or from other methods.

Value

A ggplot2 object.

Examples


fit1 <- dm.growth.fit(
  df = gf_nepa17,
  TreeNum = 1:2,
  method = "gompertz",
  year_mode = "yearly",
  verbose = FALSE
)

det1 <- dm.detrend.fit(fit1)

plot(det1)
plot(det1, type = "fit")
plot(det1, type = "residual")
plot(det1, type = "detrended")
plot(det1, type = "boxplot")
plot(det1, type = "compare", facet_by = "series")
plot(det1, type = "compare", facet_by = "season")



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