floodnetGraphics: Floodnet Plotting functions.

Description Usage Arguments Details See Also Examples

Description

Generate diagnostic plots based on the output of a modeling function floodnetMdl). Includes the following graphics: Return level plot, comparison of the flood quantiles, comparison of the coefficient of variation, L-moment ratio diagram and histogram.#'

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## S3 method for class 'floodnetMdl'
plot(x, type = "r", ...)

## S3 method for class 'floodnetMdls'
plot(x, type = "q", ...)

.PlotReturnLevel(
  x,
  point.args = NULL,
  line.args = NULL,
  ribbon.args = NULL,
  xlab = "Return periods",
  ylab = "Return levels"
)

.PlotQQ(
  x,
  point.args = NULL,
  line.args = NULL,
  ribbon.args = NULL,
  xlab = "Theoretical quantiles",
  ylab = "Sample quantiles"
)

.PlotCompareQ(x, xlab = "Return periods", ylab = "Return levels", fill = "")

.PlotCompareCv(
  x,
  line.args = NULL,
  point.args = NULL,
  xlab = "Return periods",
  ylab = "Coefficient of variation",
  colour = ""
)

.PlotLRatio(
  x,
  point.args = NULL,
  average.args = NULL,
  line.args = NULL,
  xlab = "L-Skewness",
  ylab = "L-Kurtosis",
  colour = "",
  shape = ""
)

.PlotLinTrend(
  x,
  point.args = NULL,
  line.args = NULL,
  xlab = NULL,
  ylab = NULL,
  caption = TRUE
)

## S3 method for class 'floodnetMdl'
hist(
  x,
  histogram.args = NULL,
  line.args = NULL,
  xlab = NULL,
  ylab = "Density",
  caption = TRUE,
  ...
)

## S3 method for class 'floodnetRoi'
plot(x, type = "f", ...)

Arguments

x

Input data.

type

Plot type. 'r' - Return level, 'q' - compare quantile, 'cv' - compare cv, 'l' - L-moment ratio.

...

Other parameters.

point.args, line.args, histogram.args, ribbon.args,

Parameters passed to the respective geometry.

xlab, ylab, fill, shape, colour

Labels of the XY-axis or legend.

average.args

Same as point.args for the average point.

caption

Logical. Should additional information be displayed in the caption.

Details

All functions use ggplot2 to create a basic plot that can be further customized. The default arguments of the used geometry can be overridden by passing a list of new arguments. For example, point.args = list(colour = 'red') change the colour of a set of points that was created by geom_point.

See Also

ggplot, geom_point, geom_path, geom_ribbon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library(ggplot2)

## Create a random data
set.seed(2)
xd <- SequenceData(365*30, freq = 'days', sdate = '2000-01-01')
an <- CSHShydRology::ExtractAmax(value~date,xd)

## Return level Plot
fit.an <- an$value %>%
  SequenceData() %>%
  FloodnetAmax()

plot(fit.an)

# QQ-plot
fit.pot <- FloodnetPot(xd, area = 200, u = 200)
plot(fit.pot, type = 'qq')

## Histogram
hist(fit.pot)

## Sen's slope
plot(fit.an, 't')

## Comparing flood quantiles and coefficient of variation
m2 <- CompareModels(fit.an, fit.pot)
plot(m2) + labs(fill = 'Method')
plot(m2, type = 'cv')

## L-moment ratio diagram
DemoData('region') %>%
  FloodnetPool(target = '01AF007', tol.H = Inf, verbose = FALSE) %>%
  plot(type = 'l') + labs(shape = 'Site', colour = 'Distr.')

floodnetProject16/floodnetRfa documentation built on Oct. 24, 2020, 9:19 a.m.