dm_wavelet: Wavelet analysis of dendrometer series

View source: R/dm_wavelet.R

dm_waveletR Documentation

Wavelet analysis of dendrometer series

Description

Performs continuous wavelet analysis on dendrometer time series.

The function can work with:

  • raw dendrometer series from a data frame,

  • detrended dendrometer series from dm.detrend.fit() output,

  • first differences of either raw or detrended series.

It automatically:

  • identifies the temporal resolution of the input series,

  • regularizes the series to a complete time grid,

  • optionally interpolates missing values,

  • performs wavelet analysis separately for each selected tree/series,

  • converts wavelet periods to hours for summary and plotting.

Usage

dm_wavelet(
  x,
  TreeNum = "all",
  source = c("auto", "raw", "detrended", "first_diff"),
  detrended_col = c("detrended_data"),
  na_action = c("interpolate", "fail"),
  loess_span = 0.75,
  dj = 1/20,
  lowerPeriod = NULL,
  upperPeriod = NULL,
  make_pval = TRUE,
  n_sim = 10,
  verbose = TRUE
)

Arguments

x

Input data. Either:

data.frame

First column must be time, remaining selected numeric columns are dendrometer series.

dm_detrended object

Uses x$detrended_data as input.

TreeNum

Either "all" to use all available dendrometer series, a numeric vector selecting series by position, or a character vector of series names.

source

Which series to analyze. One of:

'"auto"'

Uses raw series for a data frame input and detrended series for a dm_detrended object.

'"raw"'

Use raw dendrometer series from a data frame input.

'"detrended"'

Use detrended series from a dm_detrended object.

'"first_diff"'

Use first differences of the available input series.

detrended_col

For dm_detrended input, which table to use: "detrended_data".

na_action

How to handle missing values after completing the regular time grid. One of:

'"interpolate"'

Linearly interpolate internal gaps and carry ends forward/backward.

'"fail"'

Stop if missing values are found.

loess_span

Smoothing span passed to WaveletComp::analyze.wavelet().

dj

Frequency resolution parameter passed to WaveletComp::analyze.wavelet().

lowerPeriod

Optional lower period bound in native time units of the detected input resolution. If NULL, the default from WaveletComp::analyze.wavelet() is used.

upperPeriod

Optional upper period bound in native time units of the detected input resolution. If NULL, the default from WaveletComp::analyze.wavelet() is used.

make_pval

Logical; if TRUE, compute Monte Carlo significance.

n_sim

Number of simulations used when make_pval = TRUE.

verbose

Logical; if TRUE, prints a completion message.

Value

An object of class "dm_wavelet" with elements:

call

The matched function call.

input_type

Either "raw" or "dm_detrended".

source

Series source actually used.

series

Character vector of analyzed series names.

time_unit

Detected time unit of the input series.

dt

Detected time step in native units.

dt_hours

Detected time step expressed in hours.

resolution_seconds

Detected time step in seconds.

data_used

Regularized time series used for analysis.

results

Named list of wavelet results, one per series. Each entry contains the original WaveletComp object plus time and period-in-hours information.

settings

Analysis settings.


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