floodgraph: Generate a Graphic showing Historical Flood Frequencies or...

Description Usage Arguments Value See Also

View source: R/floodgraph.R

Description

This function automated making a simple historical graph of the frequency of flooding in prior years. It provides only limited options for customization

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
floodgraph(
  .data,
  .dt,
  .wl,
  .fldlvl,
  .type = c("count", "adjusted"),
  .fit = FALSE,
  .se = FALSE,
  .dotcol = "slateblue",
  .linecol = "black",
  .bandcol = scales::muted(.dotcol)
)

Arguments

.data

A source data frame. can be NULL if .dt and .wl are defined in the enclosing environment.

.dt

Dates and times. A data column in .data or a data vector defined in the enclosing environment that contains date-time information. Must inherit from POSIXct.

.wl

Water level. A numerical data column in .data or a numerical vector defined in the enclosing environment.

.fldlvl

The water level that defines a flood event. Needs to be expressed in the same units and the same datum as the water level data.)

.fit

TRUE/FALSE. Should a binomial GLM trendline be added to the plot? The trendline is produced from the parameters of a binomial GLM, with logit link, which estimates (possibly time-varying" )

.se

TRUE/FALSE. Should the plot show error bands showing +/- one standard error?

.dotcol

Color specification for points on the figure

.linecol

Color specification for the optional trendline

.bandcol

color specification for the optional error band

.type.

Enumerated choices. Possible values include 'count', and 'adjusted'. If 'count', the plot will show the observed number of flood events in each year. If 'adjusted', the value shows an estimate of how many flood events WOULD have happened if data for that year were complete. The adjusted value assumes risk of flooding is independent of whether data is available or not, which may be an unreasonable assumption, especially if flood risk is strongly seasonal. In practice, most NOAA stations have nearly complete data for most years, so the choice makes little difference.

Value

A list, the first item of whihc is a ggplot object. The plot has years across the x axis, and the number of flood events along the Y axis. Optionally, including a trendline. If .fit = TRUE, the list will include second item that provides summary information about the model fit.

See Also

Other Flood frequency analysis functions: .sim_once(), floodcast_tub(), floodfreq(), floodmean()


ccb60/SLRSIM documentation built on Jan. 21, 2022, 1:31 a.m.