View source: R/dm_wavelet_coherence.R
| dm_wavelet_coherence | R Documentation |
Computes cross-wavelet power and wavelet coherence between dendrometer series
and climate variables using WaveletComp::analyze.coherency().
The function:
crops dendrometer and climate inputs to their common time window,
detects their temporal resolutions,
resamples both to the coarser detected resolution,
optionally interpolates missing values,
optionally uses first differences of the dendrometer series,
computes pairwise coherence for all selected tree/climate combinations.
dm_wavelet_coherence(
dm,
clim,
TreeNum = "all",
clim_vars = "all",
source = c("auto", "raw", "detrended", "first_diff"),
detrended_col = c("detrended_data"),
dm_fun = c("mean", "max", "min", "sum"),
clim_funs = "mean",
na_action = c("interpolate", "fail"),
loess_span = 0,
dj = 1/20,
lowerPeriod = NULL,
upperPeriod = NULL,
window.type.t = 1,
window.type.s = 1,
window.size.t = 5,
window.size.s = 1/4,
make.pval = TRUE,
make_pval = NULL,
method = "white.noise",
n.sim = 10,
n_sim = NULL,
verbose = TRUE
)
dm |
Dendrometer input. Either a data frame with time in the first column
or an object of class |
clim |
Climate data frame. The first column must be time; remaining selected columns must be numeric climate variables. |
TreeNum |
Dendrometer series selector: |
clim_vars |
Climate variable selector: |
source |
One of |
detrended_col |
For |
dm_fun |
Aggregation function for dendrometer resampling: one of
|
clim_funs |
Either a single aggregation function applied to all climate
variables, or a named character vector such as
|
na_action |
One of |
loess_span |
Detrending span passed to |
dj |
Frequency resolution passed to |
lowerPeriod |
Optional lower period in native analysis units. |
upperPeriod |
Optional upper period in native analysis units. |
window.type.t |
Time-direction smoothing window type. |
window.type.s |
Scale-direction smoothing window type. |
window.size.t |
Time-direction smoothing window size. |
window.size.s |
Scale-direction smoothing window size. |
make.pval |
Logical. If |
make_pval |
Optional alias for |
method |
Surrogate generation method for p-values. |
n.sim |
Number of simulations. |
n_sim |
Optional alias for |
verbose |
Logical. |
WaveletComp::analyze.coherency() expects two aligned series in one data
frame plus a dt value in the analysis time units, and returns
cross-wavelet power, coherence, phase angles, p-values, Fourier periods, and
cone-of-influence fields.
An object of class "dm_wavelet_coherence".
wc <- dm_wavelet_coherence(
dm = gf_nepa17,
clim = ktm_clim_hourly,
TreeNum = 1,
clim_vars = c("temp", "VPD"),
source = "raw",
dm_fun = "mean",
clim_funs = c(temp = "mean", VPD = "mean"),
loess_span = 0,
make.pval = TRUE,
n.sim = 10,
verbose = FALSE
)
plot(wc)
plot(wc, type = "cross_power")
plot(wc, type = "average_coherence")
plot(wc, type = "phase")
plot(wc, type = "series")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.