Description Usage Arguments Value Author(s) References See Also Examples
Plot U.S. Geological Survey peak streamflows in peak_va
and discharge qualifications codes in the peak_cd
columns of a peak-streamflow data retrieval from the National Water Information System (NWIS) (U.S. Geological Survey, 2019). This code makes use of the add.log.axis
function from the lmomco package, and because this is the only instance of this dependency, the lmomco package is treated as a suggested package and not as a dependency for the MGBT package. The add.log.axis
function also is used for the basis of the logarithmic plot within the plotFFQevol
function.
This function accommodates the plotting of various nuances of the peak including less than (code 4), greater than (code 8), zero peaks (plotted by a green tick on the horizontal axis), and peaks that are missing but the gage height was available (plotted by a light-blue tick on the horizontal axis if the showGHyrs
argument is set). So-called code 5, 6, and 7 peaks are plotted by the numeric code as the plotting symbol, and so-called code C peaks are plotted by the letter “C.” The very unusual circumstances of codes 3 and O are plotted by the letters “D” (dam failure) and “O” (opportunistic), respectively. These codes are are summarized within splitPeakCodes
. The greater symbology set is described in the directory MGBT/inst/legend
of the package sources.
The logic herein also makes allowances for “plotting” gage-height only streamgages but this requires that the splitPeakCodes
function was called with the all_peak_na_okay
set to TRUE
. The gap analysis for gage-height only streamgages or streamgages for which the site changes from gage-height only to discharge and then back again or other permutations will likely result in the gap lines not being authoritative. The sub-bottom axis ticks for the gage-height only water years should always be plotting correctly.
1 2 3 4 5 |
x |
A |
codes |
A logical to trigger use of character plotting characters and not symbols; |
lot |
The low-outlier threshold, but if omitted, then |
site |
An optional character string for a plot title, and in practice, this is expected to be a streamgage location; |
xlab |
An optional x-label of the plot; |
ylab |
An optional y-label of the plot; |
xlim |
An optional x-limit of the plot; |
ylim |
An optional y-limit of the plot; |
xlim.inflate |
A logical to trigger nudging the horizontal axis left/right to the previous/future decade; |
ylim.inflate |
A logical to trigger nudging the vertical axis down/up to the nearest sane increment of log10-cycles. This inflation also includes a \pm0.01 log10-cycle adjustment to the lower and upper values of the limit. This ensures (say) that a 50,000 cubic feet per second maximum, which is on a sane increment, is nudged up enough to make the upper limit 60,000 instead. The point itself plots at 50,000 cfs; |
aux.y |
An optional set of values to pack into the data just ahead of the the vertical axis limits computation; |
log.ticks |
The argument |
show48 |
A logical, if |
showDubNA |
A logical, if set, will draw a \pmhalf-year polygon for the water years having both |
showGHyrs |
A logical to trigger the light-blue special ticks for the water years having only gage height. The horizontal limits will be inflated accordingly if gage heights are outside the general discharge record; and |
... |
Additional arguments to pass to |
No values are returned; this function is used for its graphical side effects.
W.H. Asquith
U.S. Geological Survey, 2019, USGS water data for the Nation: U.S. Geological Survey National Water Information System database, accessed October 11, 2019, at doi: 10.5066/F7P55KJN.
makeWaterYear
, splitPeakCodes
, plotFFQevol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # The dataRetrieval package is not required by MGBT algorithms.
# Note that makeWaterYear() is not needed because splitPeakCodes() requires
# the water_yr for gap analyses, and will call makeWaterYear() if it needs to.
PK <- dataRetrieval::readNWISpeak("08167000", convertType=FALSE)
PK <- splitPeakCodes(makeWaterYear(PK))
plotPeaks(PK, codes=TRUE, showGHyrs=FALSE,
xlab="Water year", ylab="Discharge, cfs") #
# The dataRetrieval package is not required by MGBT algorithms.
# An example with zero flows
PK <- dataRetrieval::readNWISpeak("07148400", convertType=FALSE)
PK <- splitPeakCodes(PK)
plotPeaks(PK, codes=TRUE, showDubNA=TRUE,
xlab="Water year", ylab="Discharge, cfs") #
# The dataRetrieval package is not required by MGBT algorithms.
PK <- dataRetrieval::readNWISpeak("08329935", convertType=FALSE)
PK <- splitPeakCodes(PK)
plotPeaks(PK, codes=TRUE, showDubNA=TRUE,
xlab="Water year", ylab="Discharge, cfs") #
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.