akq_table: Tabulate (Extract) Raw Discharge Decay Computations

Description Usage Arguments Value Author(s) See Also Examples

Description

Extract the raw computations from output of akqdecay and place the results into an R data.frame. This function will insert a row of NA's into the returned table of the changes from one streamgage to the next using the built-in R rbind() function. The inserted line will look something like row 9069:

1
2
3
4
9068  05403500  2016 2016     3   2010 2016-03-26 9.211251e-01 1040 ... etc ...
9069      <NA>    NA   NA    NA     NA       <NA>           NA   NA ... etc ...
9070  05405000  1945 1945     1   1940 1945-01-04 1.045350e-02   90 ... etc ...
   ... etc ...

By providing this NA, as shown, graphical operations on the table will be able to “lift the pen” when the successive streamgage is encountered.

Usage

1
2
akq_table(akqenv, NAline.insert=TRUE, type=c("akqdecay", "other"),
                                      silent=FALSE, ...)

Arguments

akqenv

The R environment previously populated by fill_akqenv. This argument can also be an R list directly from akqdecay; special accommodation is made;

NAline.insert

A logical that can be used to suppress the NA line insertion described in the Description section;

type

What type of table is sought? The "akqdecay" means that the Z$table of the list from fill_akqenv is to be extracted from the value Z in the environment stored under the site. The "other" just means that the environment is storing data frames, and this type is for environments from fill_dvenv or fill_dvpartenv. Internally, the source code has some different column accessing based on type that is partly an artifact of early design decision;

silent

Suppress informative calls to message(); and

...

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

Value

An R data.frame containing the counts for each streamgage.

site

The streamgage identification number;

wyear

The water year;

year

The calendar year;

month

The month;

decade

The decade of the calendar year;

date

The date of the “tomorrow” streamflow (forward bias);

fdc

The nonexceedance probability from the flow-duration curve for the period of record;

fqc

The “tomorrow” streamflow for the date;

days_per_log

Days per log cycle change of streamflow and dependent on the setting for method in akqdecay; and

pp_days_per_log

Weibull plotting position of days_per_log.

Author(s)

W.H. Asquith

See Also

akqdecay

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)
TAB <- akq_table(WisAKQ); TAB$color <- as.numeric(as.factor(TAB$site))+1
plot(qnorm(TAB$pp_days_per_log), TAB$days_per_log, type="p", col=TAB$color,
     cex=0.6, log="y", xlab="Standard Normal Variate", ylab="days per log-cycle")

plot(TAB$date, TAB$days_per_log, log="y", type="p",
     col=TAB$color, xlim=as.Date(c("1960-01-01", "1960-06-01"))) #

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