dcompare: Compare distribution function of variables

Description Usage Arguments Value Examples

Description

Compare distribution function of variables

Usage

1
2
dcompare(x, compare_to, p = seq(0, 1, 0.01), wet_int_only = TRUE,
  wet_int_thr = 0.1, exclude_below = 0.9)

Arguments

x

List of decomposed objects

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 exclude_below argument controls the minimum fraction of the interval that has to be available in order to be considered in the summary statistics.

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 by names(x)

DIF

distance between quantiles of x and compare_to. Distance is measured as difference for variables included in getOption('additive_variables'), i.e. temperature (TAS) by default, and as a ratio for other variables, see dif

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(ggplot2)
data(basin_PT)
## Not run: 
dobs = decomp(basin_PT[['obs_ctrl']])
dctrl = decomp(basin_PT[['sim_ctrl']])
d = dcompare(x = list(CTRL = dctrl), compare_to = dobs)
ggplot(d[variable=='TAS' & period!='G1']) +
  geom_line(aes(x = p, y = DIF, col = comp)) +
  facet_grid(sub_period~period, scale = 'free') +
  theme(legend.position = 'top', axis.text.x = element_text(angle = 90, vjust = .5))

## End(Not run)

hanel/musica documentation built on May 17, 2019, 2:28 p.m.