Learn R Programming

EGRET (version 3.0.9)

populateDaily: Populate Daily data frame

Description

Using raw data that has at least dateTime, value, code, populates the rest of the basic Daily data frame used in EGRET analysis.

Usage

populateDaily(rawData, qConvert, verbose = TRUE)

Value

A data frame 'Daily' with the following columns:

NameTypeDescription
QnumericDischarge in m^3/s
JulianintegerNumber of days since Jan. 1, 1850
MonthintegerMonth of the year [1-12]
DayintegerDay of the year [1-366]
DecYearnumericDecimal year
MonthSeqintegerNumber of months since January 1, 1850
QualifiercharacterQualifying code
iintegerIndex of days, starting with 1
LogQnumericNatural logarithm of Q
Q7numeric7 day running average of Q
Q30numeric30 day running average of Q

Arguments

rawData

dataframe contains at least dateTime, value, code columns

qConvert

character conversion to cubic meters per second

verbose

logical specifying whether or not to display progress message

Author

Robert M. Hirsch rhirsch@usgs.gov

See Also

readNWISDaily, readUserDaily

Examples

Run this code
dateTime <- as.character(seq(as.Date("2001/1/1"), 
         as.Date("2001/12/31"), by = "day"))
value <- 1:365
code <- rep("",365)
dataInput <- data.frame(dateTime, value, code, stringsAsFactors=FALSE)
Daily <- populateDaily(dataInput, 2)

Run the code above in your browser using DataLab