cycle_stats: Define stem cycles and calculate statistics for all cyclic...

View source: R/cycle_stats.R

cycle_statsR Documentation

Define stem cycles and calculate statistics for all cyclic phases

Description

The function defines stem cycles from output of phase_def and calculates statistics for complete cycles as well as for the phases of contraction, expansion and stem-radius increment.

Usage

cycle_stats(dm.gpf, dm.phase, sensor = 1, smooth.param = 1)

Arguments

dm.gpf

a data.frame with either gap-free or gap-filled dendrometer series as produced by fill_gaps.

dm.phase

a data.frame with numbers indicating the different stem-cyclic phases. Output of phase_def.

sensor

a numeric specifying the sensor to be used in the function. Defaults to 1 (first column in both data.frames).

smooth.param

a numeric specifying the degree of smoothing. Defaults to 1 (no smoothing).

Details

The function uses the output of phase_def to define stem cycles and to calculate statistics for all cyclic phases. These statistics include the timing and duration of each phase, as well as information on stem-size changes. The function works for single dendrometer series, which are defined by the argument sensor.

The function includes a smoothing option (argument smooth.param) particularly for noisy datasets in which outliers may under- or overestimate the minimum and maximum stem size within phases and stem cycles. By default, no smoothing is performed.

Value

The function returns a list with:

  • a data.frame named cycleStats containing the following summary statistics:

dmID

dendrometer ID.

cycle

cycle number.

phase

cyclic phase (1: contraction, 2: expansion, 3: stem-radius increment, 4: full cycle).

begin

timestamp indicating the beginning of each phase.

end

timestamp indicating the end of each phase.

duration_h

phase duration in hours.

duration_m

phase duration in minutes.

magnitude

magnitude of stem-size changes in each phase.

min

minimum stem size within each phase.

max

maximum stem size within each phase.

  • a data.frame named cycle.df containing, for all individual records, the following columns:

dmID

dendrometer ID.

cycle

cycle number.

phase

cyclic phase (1: contraction, 2: expansion, 3: stem-radius increment, 4: full cycle).

Author(s)

Olivier Bouriaud, Ernst van der Maaten and Marieke van der Maaten-Theunissen.

Examples

data(dmCD)
dm.phase <- phase_def(dmCD)
dm.stats <- cycle_stats(dmCD, dm.phase)


smiljanicm/dendrometeR documentation built on April 24, 2023, 2:57 p.m.