climate_seg: Segmenting climate and environmental data

Description Usage Arguments Details Value Examples

View source: R/climate_seg.R

Description

The function calculates means or sums, or extracts minimum or maximum values of environmental parameters for stem-cyclic phases as defined using cycle_stats.

Usage

1
2
climate_seg(env.data, dm.stats, value = c("mean", "min",
            "max", "sum"))

Arguments

env.data

a data.frame with with a timestamp (%Y-%m-%d %H:%M:%S format) as row names, and a certain climate parameter (e.g., temperature or precipitation) in columns.

dm.stats

a list as produced by cycle_stats.

value

a character string of "mean", "min", "max" or "sum", specifying whether means (e.g., for temperature) or sums (e.g., for precipitation) should be calculated, or minimum or maximum values should be extracted. Defaults to "mean". Argument matching is performed.

Details

The function segments environmental parameters according to the stem-cyclic phases as defined using cycle_stats. Means, sums, and minimum and maximum values can be calculated or extracted.

env.data should cover at least the same period as the dendrometer data used to define the cyclic phases, and should have the same (or a higher) temporal resolution.

Value

The function returns a data.frame with segmented environmental data. The data.frame contains the following columns:

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.

...

columns with segmented environmental data (mean, min, max or sum).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

data(dmED)
dm.gpf <- fill_gaps(dmED)
dm.phase <- phase_def(dm.gpf)
dm.stats <- cycle_stats(dm.gpf, dm.phase)
data(envED)
clim.phase <- climate_seg(envED, dm.stats, value = "mean")

## End(Not run)

dendrometeR documentation built on May 2, 2019, 6:34 a.m.