Description Usage Arguments Value Note Author(s) See Also Examples
Extract the count table (counts
) from Asquith–Knight discharge decay analyses. The count table is an R data.frame
has been already made by akqdecay
for a sequence of USGS streamgage identification numbers contained within an R environment
. This environment has already been populated by fill_akqenv
. The various counts of direction of change in the daily-mean streamflows are computed (decreasing, increasing, or no change) in akqdecay
regardless of the arguments decreasing
and lag
originally passed to that function.
1 | akq_counts(akqenv, silent=FALSE, ...)
|
akqenv |
The R |
silent |
Suppress informative calls to |
... |
Additional arguments to pass (see source code to ascertain flexible usage). |
An R data.frame
containing the counts for each streamgage.
site |
The streamgage identification number; |
total_count |
The total number of daily-mean streamflow values; |
decreases |
The number of decreases (\checkΨ); |
increases |
The number of increases (\hatΨ); |
nochanges |
The number of no changes (\ddotΨ); |
NAs |
The number of missing values. Total count is the sum of the decreases, increases, no changes, and number of |
rawDV_zeros |
This is a counter on the number of zero values before the differencing (the original data), hence the term |
rawDV_NAs |
This is a counter on the number of |
delDates_ne_lag |
This is a “delta (change) between dates not equal to the lag” counter. Such a counter tracks the number of changes between successive dates that are not equal to the |
What does delta (change) between dates not equal to the lag mean? Gaps in record should result in a missing value for the “tomorrow” date (note the use of the subscripts for date in the text that follows as presenting the tomorrow [forward bias notation]). For example, a transition from \mathrm{Jan1} (January 1st) to \mathrm{Jan2} would have a Δ\mathrm{Date}_\mathrm{Jan2} = 1, but a transition from \mathrm{Jan2} to \mathrm{Jan4} because \mathrm{Jan3} is not available (say the streamgage was not operational or perhaps record flagged as provisional and that record was ignored) would have a Δ\mathrm{Date}_\mathrm{Jan4} = 2. If the lag=1
, then only the former and not the later enter into statistical computation.
Visualization of count distributions? Here is a recipe for visualizing the quantile distribution of the total number of Ψ available in akqenv
:
1 2 3 4 5 6 7 8 9 10 | CN <- akq_counts(akqenv)
ylim <- range(CN$total_count, CN$nochanges, CN$increases, CN$decreases)
ylim[1] <- ifelse(ylim[1] == 0, 1, ylim[1])
plot(qnorm(lmomco::pp(CN$total_count)),sort(CN$total_count),log="y",lwd=0.8,
xlab="Standard Normal Variate", ylab="Number of Differences")
points(qnorm(lmomco::pp(CN$nochanges)), sort(CN$nochanges), col=3, lwd=0.8)
points(qnorm(lmomco::pp(CN$increases)), sort(CN$increases), col=4, lwd=0.8)
points(qnorm(lmomco::pp(CN$decreases)), sort(CN$decreases), col=2, lwd=0.8)
legend(0,100, c("total_count", "nochanges", "increases", "decreases"),
col=c(1,3,4,2), pch=c(1,1,1,1), bty="n")
|
W.H. Asquith
akqdecay
, fill_akqenv
, akq_lmom
, akq_summary
1 2 3 4 5 6 7 8 9 10 11 | sites <- c("05403500", "05405000") # Two USGS streamgages in Wisconsin
WisExample <- new.env(); fill_dvenv( sites, envir=WisExample,
sdate="1945-01-01", edate="2014-12-31")
WisAKQ <- new.env(); fill_akqenv(dvenv=WisExample, envir=WisAKQ)
akq_counts(WisAKQ) # hand editing for line wrapping made below
# site total_count decreases increases nochanges NAs
#05403500 17714 8829 6023 2852 9
#05405000 25566 13293 9415 2858 0
# site rawDV_zeros rawDV_NAs delDates_ne_lag
#05403500 0 0 9
#05405000 0 0 0 #
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.