probPlot: Probability Plot

View source: R/probPlot.R

probPlotR Documentation

Probability Plot

Description

Creates a probability plot.

Usage

probPlot(x, truncate = NA, FLIP = FALSE, distribution = "normal",
  alpha = 0.4, Plot = list(name = "", what = "points", type = "solid",
  width = "standard", symbol = "circle", filled = TRUE, size = 0.09, color
  = "black"), yaxis.log = TRUE, yaxis.range = c(NA, NA),
  ylabels = 11, xlabels = 11, CDF = !RI, xtitle = ifelse(CDF,
  "Cumulative Probability", "Exceedence Probability"), RI = FALSE,
  RItitle = "Recurrence Interval, in years",
  ytitle = deparse(substitute(x)), caption = "", margin = c(NA, NA,
  NA, NA), ...)

## Default S3 method:
probPlot(x, truncate = NA, FLIP = FALSE,
  distribution = "normal", alpha = 0.4, Plot = list(name = "", what =
  "points", type = "solid", width = "standard", symbol = "circle", filled =
  TRUE, size = 0.09, color = "black"), yaxis.log = TRUE,
  yaxis.range = c(NA, NA), ylabels = "Auto", xlabels = 11,
  CDF = !RI, xtitle = ifelse(CDF, "Cumulative Probability",
  "Exceedence Probability"), RI = FALSE,
  RItitle = "Recurrence Interval, in years",
  ytitle = deparse(substitute(x)), caption = "", margin = c(NA, NA,
  NA, NA), ...)

Arguments

x

the data to plot. Missing values are allowed and ignored.

truncate

truncate the data at the specified value. See Details.

FLIP

if TRUE, then plot the cumulative distribution. Otherwise, plot as flipped data (largest values on left).

distribution

the name of the desired function converting from probabilities to coordinates.

alpha

the alpha value of the function for computing plotting positions.

Plot

parameters defining the characteristics of the plot. See setPlot for a description of the parameters.

yaxis.log

logical, if TRUE, then log-transform the y axis.

yaxis.range

set the range of the y axis. See Details.

ylabels

set the y-axis labels. See logPretty for yaxis.log set to TRUE or linearPretty for yaxis.log set to \ceodeFALSE for details.

xlabels

set the x-axis labels. See probPretty for details.

CDF

logical, if TRUE, then label with increasing probabilities. Otherwise label with decreasing probabilities.

xtitle

the x-axis title (also called x-axis caption).

RI

logical, if TRUE, then label the top axis with recurrence intervals. If RI is set to TRUE, then CDF will be set to FALSE.

RItitle

the top x-axis title if RI is TRUE.

ytitle

the y-axis title (also called y-axis caption).

caption

the figure caption.

margin

set the plot area margins, in units of lines of text. Generally all NA or the output from setGraph if appropriate.

...

parameters for the distribution function. If any parameter is specified, then an attempt is made to draw the fit between the computed distribution and the observed data.

Details

Truncation of the data to plot (x) results in a conditional probability plot. For any numeric value for truncate, the values in x less than or equal to truncate are not plotted and the remaining values are plotted at their conditional probability (the probability computed with all values). The behavior for the default value for truncate = NA, depends on yaxis.log. If yaxis.log is TRUE, then truncate is treated as though it was 0; otherwise truncate is treated as though it was -Inf, which results in no truncation.

For linear axes, the range can be set to virtually any pair of values. For log axes, the choice of range is more resticted—for less than one log-cycle, powers of whole numbers can be used; from 1 to about 3 log cycles, the choces should be powers of 3 or 10; and for more than 3 log cycles, the range sould be expressed only in powers of 10.

Value

Information about the graph.

Note

A call should be made to setPage to set up the graphics environment before calling probPlot.

See Also

setPage, ecdfPlot, qqPlot

Examples

## Not run: 
set.seed(1)
X <- rlnorm(32)
setGD()
probPlot(X)
# For more details of probPlot see
vignette(topic="ProbabilityPlots", package="smwrGraphs")
demo(topic="FlowDur-Measurements", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.