dm_join_phase_clim: Join climate summaries to dendrometer phase windows

View source: R/dm_join_phase_clim.R

dm_join_phase_climR Documentation

Join climate summaries to dendrometer phase windows

Description

Summarizes climate conditions within each phase window of phase.zg() or phase.sc() output and appends those summaries to ZG_cycle or SC_cycle.

The climate input can be:

  • the output of read.climate()

  • a raw climate data frame

  • a valid climate file path readable by read.climate()

Climate variables are summarized over each phase interval defined by the Start and End columns of the phase-cycle table.

Usage

dm_join_phase_clim(
  x,
  clim_df,
  mean_vars = NULL,
  min_vars = NULL,
  max_vars = NULL,
  sum_vars = NULL,
  median_vars = NULL,
  suffix = "_phase"
)

Arguments

x

Object returned by phase.zg() or phase.sc().

clim_df

Climate input. This can be a standardized climate object returned by read.climate(), a raw climate data frame, or a valid climate file path.

mean_vars

Character vector of climate variables to summarize by mean within each phase window.

min_vars

Character vector of climate variables to summarize by minimum within each phase window.

max_vars

Character vector of climate variables to summarize by maximum within each phase window.

sum_vars

Character vector of climate variables to summarize by sum within each phase window.

median_vars

Character vector of climate variables to summarize by median within each phase window.

suffix

Character suffix appended to the generated climate summary columns. Default is "_phase".

Value

The same phase object with climate summaries appended to ZG_cycle or SC_cycle. The returned object has class c("ZG_output_clim", "ZG_output", ...) or c("SC_output_clim", "SC_output", ...).

Examples


data(gf_nepa17)
data(ktm_clim_hourly)

zg <- phase.zg(df = gf_nepa17[1:800, ], TreeNum = 1)

zg_clim <- dm_join_phase_clim(
  zg,
  ktm_clim_hourly,
  mean_vars = c("temp", "VPD", "RH"),
  max_vars  = c("temp", "VPD"),
  sum_vars  = c("prec")
)

head(zg_clim$ZG_cycle)



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