| mov.cor.dm | R Documentation |
Calculates running correlations between a selected daily dendrometer summary and one or more climate variables. The user can select the daily dendrometer statistic, correlation method, optional bootstrap confidence intervals, and lagged / antecedent climate transformations.
mov.cor.dm(
df,
Clim,
TreeNum,
win_size,
cor_method = c("pearson", "kendall", "spearman"),
boot = FALSE,
R = 1000,
boot.ci = 0.05,
set_seed = 1,
dm_stat = c("mean", "min", "max", "median", "amplitude", "change"),
clim_vars = NULL,
lag_days = 0,
accum_days = 1,
clim_fun = "raw",
min_complete = NULL,
p_adjust_method = "BH"
)
df |
A data frame with the first column containing date-time in the format
|
Clim |
A data frame with the first column containing daily date
( |
TreeNum |
Integer indicating the dendrometer series to analyze. |
win_size |
Integer giving the running window size in days. Minimum is 18. |
cor_method |
Correlation method: one of |
boot |
Logical. If |
R |
Integer number of bootstrap iterations. |
boot.ci |
Numeric confidence level selector: one of |
set_seed |
Integer seed for reproducibility of bootstrap results. |
dm_stat |
Daily dendrometer statistic used for correlation. One of
|
clim_vars |
Optional character vector of climate variables to analyze.
If |
lag_days |
Climate lag in days. Can be:
|
accum_days |
Antecedent window length in days for climate transformation. Can be scalar, per-variable, or a named numeric vector. |
clim_fun |
Climate transformation over the antecedent window. One of
|
min_complete |
Minimum number of complete paired observations required in
a running window to calculate correlation. If |
p_adjust_method |
Method for p-value adjustment in the non-bootstrap
output. Passed to |
The dendrometer series is first aggregated to daily resolution. The daily
dendrometer statistic used for correlation is controlled by dm_stat:
"mean": daily mean dendrometer value
"min": daily minimum
"max": daily maximum
"median": daily median
"amplitude": daily amplitude (max - min)
"change": day-to-day change in the daily mean
Users can choose the climate variables to analyze via clim_vars.
Climate transformation settings can be given as:
a single value applied to all selected climate variables
an unnamed vector with one value per selected climate variable
a named vector mapping each selected climate variable to its own setting
This applies to clim_fun, lag_days, and accum_days.
A list with class "mov_cor_dm" (and "mov_cor_dm_boot" if
bootstrapped) containing:
results: named list of tibbles, one per climate variable
metadata: analysis metadata
call: the matched function call
library(dendRoAnalyst)
data(gf_nepa17)
data(ktm_rain17)
# one common climate transformation for all selected variables
out_corr <- mov.cor.dm(
df = gf_nepa17,
Clim = ktm_rain17,
TreeNum = 1,
win_size = 21,
clim_fun = "raw"
)
print(out_corr)
summary(out_corr)
# variable-specific climate transformations
out_varfun <- mov.cor.dm(
df = gf_nepa17,
Clim = ktm_rain17,
TreeNum = 1,
win_size = 21,
clim_vars = c("rainfall"),
clim_fun = c(rainfall = "sum"),
lag_days = c(rainfall = 1),
accum_days = c(rainfall = 7)
)
# bootstrap confidence intervals
out_boot <- mov.cor.dm(
df = gf_nepa17,
Clim = ktm_rain17,
TreeNum = 1,
win_size = 21,
boot = TRUE,
R = 250
)
summary(out_boot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.