vcompare {musica} | R Documentation |
Assess the relations between two decomposed variables
Description
Assess the relations between two decomposed variables
Usage
vcompare(x, fun = cor, wet_int_only = TRUE, wet_int_thr = 0.1,
exclude_below = 0.9)
Arguments
x |
List of decomposed objects |
fun |
Function to sumarize dependence (like |
wet_int_only |
(logical) Should only the wet intervals be considered? |
wet_int_thr |
Numeric value specifying the minimum depth to be consider wet |
exclude_below |
Some of the intervals might not be of required length, e.g. D10 interval may have less than 10 days available. The |
Details
vcompare
compares the relation between all pairs of variables included in x
, typically precipitation and temperature, but other variables may be included also (e.g. runoff).
Value
data.table summarizing the relation with columns:
- variable
factor indicating the variable
- period
specification of the averaging length with 'D' - day(s), 'M' - month(s), 'Y' - year(s) and 'G1' - the overall mean
- TS
averaging length in hours
- sub_period
indication of the aggregating scale specified by
agg_by
argument- comp
factor indicating the data sets from
x
with labels given bynames(x)
- DIF
distance between data sets from
x
andcompare_to
. Distance is measured as difference for variables included ingetOption('additive_variables')
, i.e. temperature (TAS
) by default, and as a ratio for other variables, seedif
Examples
library(ggplot2)
data(basin_PT)
## Not run:
dobs = decomp(basin_PT[['obs_ctrl']])
dctrl = decomp(basin_PT[['sim_ctrl']])
d = vcompare(x = list(OBS = dobs, CTRL = dctrl), fun = cov)
ggplot(d[period!='G1']) +
geom_line(aes(x = TS, y = value, col = factor(sub_period))) +
facet_grid(VARS~ID) +
scale_x_log10()
## End(Not run)