akq_write: Write Tables from Data Frames

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Write the R data.frame produced by either akq_counts, akq_lmom, akq_summary, and akq_table to the file system via a wrapper on the built-in R write.table() function. The output has quotation marks stripped and no row names [row.names()].

Usage

1
2
akq_write(df, file=NA, sep=";", digits=6, silent=FALSE,
              header="# optional header string", ...)

Arguments

df

An R data.frame;

file

The file name, and if NA, then this function has no effect;

sep

The separator for the output file;

digits

The number of digits to round for the numerical columns of the data.frame;

silent

Suppress informative calls to message();

header

An optional header to be written above the output via the built-in R sink(). The user need not worry about a terminal line ending as this function appends a newline before the sinking; and

...

Additional arguments to pass to control the write.table() function.

Value

This function has no returned value and is intended for its side effects.

Note

The built-in R write.table() function is used. This function is called by hardwired options append=TRUE, quote=FALSE, and row.names=FALSE, but the ... argument is passed to function write.table(), thus a user can access all of the other options of that function. For example, suppose a user does not desire the column names, then col.names=FALSE could be included in the ... arguments.

Author(s)

W.H. Asquith

See Also

akqdecay, akq_scibase

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
sites <- c("05403500", "05405000") # Two 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)
WisLM <- akq_lmom(WisAKQ)
akq_write(WisLM, file="BarabooRiverLM.txt",
                 header="# L-moments of the 1-day declines") #
## End(Not run)

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