The function calculates various daily statistics for dendrometer and environmental data. It either returns multiple statistics for individual sensors, or a single statistic for multiple sensors.
daily_stats(dm.data, sensor = 1, value = c("mean", "min",
"max", "sum"), smooth.param = 1)The function returns:
for sensor is numeric, a data.frame containing the following columns:
dendrometer ID.
timestamp in %Y-%m-%d format.
day of year.
minimum daily stem size.
mean daily stem size.
maximum daily stem size.
amplitude of daily stem-size changes (i.e. max - min).
timestamp indicating the timing of the minimum.
timestamp indicating the timing of the maximum.
for sensor is "ALL":
a data.frame with a timestamp (%Y-%m-%d) as row names, and processed dendrometer or environmental data in columns (i.e. mean, minimum, maximum or sum).
a data.frame with a timestamp (%Y-%m-%d %H:%M:%S format) as row names, and dendrometer series in columns. Output as created using code from the Import dendrometer data vignette, or gap-filled dendrometer series as produced by fill_gaps. Environmental data can be specified as well, and should be formatted as dendrometer data.
a numeric or character string specifying the sensor(s) to be used in the function. Defaults to 1 (first column of data.frame). If "ALL" is specified, a single value will be calculated or extracted for all series in the data.frame.
a character string of "mean", "min", "max" or "sum", specifying the daily statistic to be calculated or extracted. Optional argument for sensor = "ALL", defaults to "mean". Argument matching is performed.
a numeric specifying the degree of smoothing. Defaults to 1 (no smoothing). In case smoothing is applied, series should be gap-free or gap-filled.
Olivier Bouriaud, Ernst van der Maaten and Marieke van der Maaten-Theunissen.
The function calculates various daily statistics for dendrometer and environmental data. For sensor is numeric, the function returns multiple statistics for a single sensor. For sensor = "ALL", the function returns a single statistic (i.e. "mean", "min", "max" or "sum") for all columns of the data.frame, whereby "sum" is particularly relevant for environmental parameters like precipitation.
The function includes a smoothing option (argument smooth.param) particularly for noisy datasets in which outliers may under- or overestimate minimum and maximum stem sizes within days. By default, no smoothing is performed. Smoothing requires gap-free series.
data(dmCD)
dm.daily <- daily_stats(dmCD, sensor = 1)
data(dmED)
dm.daily <- daily_stats(dmED, sensor = "ALL", value = "max")
Run the code above in your browser using DataLab