makeWaterYear: Make Water Year Column

Description Usage Arguments Value Author(s) See Also Examples

Description

Make water year, year, month, and day columns from the date stamp of a U.S. Geological Survey peak-streamflow data retrieval from the National Water Information System (NWIS) in an R data.frame into separate columns of the input data.frame.

Usage

1

Arguments

x

A data.frame having a mandatory column titled peak_dt presented by
as.character. No other information in x is consulted or otherwise used.

Value

The x is returned with the addition of these columns:

year_va

The calendar year extracted from peak_dt;

month_va

The optional month extracted from peak_dt;

day_va

The optional day extracted from peak_dt; and

water_yr

The water year, which is not equal to year_va if month_va is greater than or equal to 10 (October).

Author(s)

W.H. Asquith

See Also

splitPeakCodes, plotPeaks

Examples

1
2
3
4
5
## Not run: 
  PK <- dataRetrieval::readNWISpeak("08167000", convertType=FALSE)
  PK <- makeWaterYear(PK) # Note: The convertType=FALSE is critical.
  names(PK) # See that the columns are there.
## End(Not run)

wasquith-usgs/MGBT documentation built on Aug. 6, 2019, 4:57 p.m.