countLMdfs: Counts and Percentages from L-moment Tables of the...

Description Usage Arguments Value Author(s) See Also Examples

Description

Extract and combine the counts from various yearly or decadal L-moment tables between the three computation methods of Asquith–Knight discharge decay analyses and compute relative percentages. A check is made internally that the ordering of the arguments DECR, INCR, and NC looks proper—meaning that total summation (all sites and year/decade) of \checkΨ (decreasing) are larger than total summation of \hatΨ and larger than total summation of \ddotΨ, and total summation of \hatΨ is larger than total summation of \ddotΨ. This check is made because the number of decreases is almost uniformly about twice as often as increases and both those are larger than the number of no changes. Mathematically, for indicator function \mathbf{1}(x_i) for the presence of the ith value in the sample, the relations among the Ψ are

∑_{i=1}^n \mathbf{1}(\checkΨ_i) ≥ ∑_{i=1}^n \mathbf{1}(\hatΨ_i) ≥ ∑_{i=1}^n \mathbf{1}(\ddotΨ_i)\mbox{.}

Usage

1
countLMdfs(DECR, INCR, NC, silent=FALSE, ...)

Arguments

DECR

A decreasing (the method call on akqdecay) L-moment table (year or decade) from akq_lmom_yeardecade;

INCR

An increasing (the method call on akqdecay) L-moment table (year or decade) from akq_lmom_yeardecade;

NC

An nochange (the method call on akqdecay) L-moment table (year or decade) from akq_lmom_yeardecade;

silent

Suppress informative calls to message(); and

...

Additional arguments to pass (see source code to ascertain flexible usage).

Value

An R data.frame is returned having attributes (attr() function) of skipped_sites and which (year or decade) and contains

site

The streamgage identification number;

year/decade

The type of aggregation;

total_count_minusNAs

The total number of daily-mean streamflow values. However, the counts of the NAs that are reported for the period of record by akq_counts not not available (This might be a TODO for the package). This total is ∑ [\mathbf{1}(\checkΨ) + \mathbf{1}(\hatΨ) + \mathbf{1}(\ddotΨ)];

decreases

The number of decreases (\checkΨ) during the year or decade;

increases

The number of increases (\hatΨ) during the year or decade;

nochanges

The number of no changes (\ddotΨ) during the year or decade;

pct_decreases

Percent of decreases relative to total_count_minusNAs;

pct_increases

Percent of increases relative to total_count_minusNAs; and

pct_nochanges

Percent of no changes relative to total_count_minusNAs.

Author(s)

W.H. Asquith

See Also

akq_lmom_year, akq_lmom_decade

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
## Not run: 
# Suppose LDd [decreasing], LDi [increasing], LDnc [nochange] are from
# LDd <- akq_lmom_decade(AKd); LDi <- akq_lmom_decade(AKi); LDnc <- akq_lmom_decade(AKnc)
# for which AKd, AKi, and AKnc are from fill_akqenv(..., method="decreasing") etc...
DIN <- countLMdfs(LDd, LDi, LDnc) # *** Here is the example operation. ***
# Here follows the function's response via message() during some testing.
#countLMdfs: remember that counts of NAs (record gaps or zero flows) are not included.
#    Totals: decreases=10971798, increases=5627551, and nochanges=1976068 and data.frame
#    argument ordering seems consistent.
par(las=1, xaxs="i", yaxs="i")
plot(jitter(DIN$decade, factor=2), DIN$pct_decreases, cex=0.6, tcl=0.5,
     xlim=c(1880,2020), ylim=c(0,100), col="#FB6A4A", lwd=0.5,
     xlab="DECADE", ylab="FRACTION OF TIME")
points(jitter(DIN$decade, factor=2), DIN$pct_increases, cex=0.6, col="#6BAED6", lwd=0.5)
points(jitter(DIN$decade, factor=2), DIN$pct_nochanges, cex=0.6, col="#74C476", lwd=0.5)
tmp <- DIN[complete.cases(DIN),]
lines(lowess(tmp$decade, tmp$pct_decreases), col="#A50F15", lwd=2)
lines(lowess(tmp$decade, tmp$pct_increases), col="#08519C", lwd=2)
lines(lowess(tmp$decade, tmp$pct_nochanges), col="#006D2C", lwd=2)
# This example uses jitter() because likey enormous overlap of points for a given
# decade will occur. The lowess() lines are drawn to help visualize the pattern.
# A common pattern seen in exploratory analysis is a systematic decrease in no changes
# from the earliest days of the USGS streamgaging to modern times. Ramifications of this
# are not fully understood (noted March 30, 2017, wha/rrk).
## End(Not run)

wasquith-usgs/akqdecay documentation built on Nov. 9, 2020, 1:13 p.m.