Learn R Programming

TLMoments (version 0.7.5.3)

plot.TLMoments: L-Moment-ratio diagram

Description

Generates a ggplot2 object containing a scatterplot of TL skewness and TL kurtosis as well as the theoretical curves and points of several distributions (for now: GEV, GPD, LN3, GUM, EXP, NORM).

Usage

# S3 method for TLMoments
plot(x, ...)

# S3 method for numeric plot.TLMoments(x, distr = "all", add_center = FALSE, use_internal = TRUE, ...)

# S3 method for matrix plot.TLMoments(x, distr = "all", add_center = TRUE, use_internal = TRUE, ...)

# S3 method for list plot.TLMoments(x, distr = "all", add_center = TRUE, use_internal = TRUE, ...)

# S3 method for data.frame plot.TLMoments(x, distr = "all", add_center = TRUE, use_internal = TRUE, ...)

Arguments

x

object of TLMoments.

...

additional arguments, not used at the moment.

distr

character indicating the plotted theoretical distributions, see details.

add_center

boolean, if TRUE (default, except for vector TLMoments) the center of all TL-moment ratios is printed as a cross.

use_internal

boolean, if TRUE (default) internal pre-calculated values (if available) are used to print curves and points.

Value

A ggplot object.

Methods (by class)

  • numeric: plot.TLMoments for numeric vector

  • matrix: plot.TLMoments for numeric matrix

  • list: plot.TLMoments for numeric list

  • data.frame: plot.TLMoments for numeric data.frame

Details

distr: this can either be a vector containing the abbreviations of the theoretical distributions (gev, gpd, ln3, pe3, glo, gum, exp, or norm) or one of the shortcuts \"all\" (default), \"only-lines\", or \"only-points\" that indicate all distributions, all distributions displayed as lines (i.e. gev, gpd, ln3, pe3, glo), or all distributions displayed as points (ie. gum, exp, norm), respectively.

Values of theoretical distributions are pre-calculated for several trimmings. If other trimmings are selected this results in a (small) delay for calculation.

Examples

Run this code
# NOT RUN {
xmat <- matrix(rgev(1000, shape = .1), nc = 10)
xvec <- xmat[, 3]
xlist <- lapply(1L:ncol(xmat), function(i) xmat[, i])
xdat <- data.frame(
 station = rep(letters[1:10], each = 100),
 season = rep(c("S", "W"), 50),
 hq = as.vector(xmat)
)

library(ggplot2)
plot(TLMoments(xvec))
plot(TLMoments(xlist), distr = c("gev", "gum"), add_center = FALSE)
plot(TLMoments(xmat), distr = "only-points")
plot(TLMoments(xmat), distr = "only-lines") + scale_colour_viridis_d()
plot(TLMoments(xmat, 0, 1))
plot(TLMoments(xmat, 0, 1)) + coord_cartesian(xlim = c(-.05, .4), ylim = c(.05, .2))
plot(TLMoments(xdat, hq ~ station, 1, 0))

plot(TLMoments(xmat), add_center = FALSE)
plot(TLMoments(xmat), use_internal = FALSE)
plot(TLMoments(xmat, 2, 3))
# }

Run the code above in your browser using DataLab