asStreamflow {discharge}R Documentation

Create streamflow object

Description

This function converts a dataset to S3 object of class "streamflow". Data in this format can be provided as arguments to other functions to call default procedures.

Usage

asStreamflow(x,river.name=NULL, start.date=NULL, end.date=NULL,max.na=10)
## S3 method for class 'streamflow'
print(x, ...)
## S3 method for class 'streamflow'
summary(object, ...)

Arguments

x, object

A matrix with dates in the first column and discharge values in the second column. Dates should be of the format "YYYY-MM-DD".

river.name

A character vector listing the river name.

start.date

Optional character string giving date to start analysis, of the format "YYYY-MM-DD"

end.date

Optional date to start analysis, of the format "YYYY-MM-DD"

max.na

Optional number specifying maximum NA values to allow.

...

Other parameters.

Value

An object of class streamflow containing the following items:

data

Data frame with 8 columns

n

Number of observations in series.

n.nas

Number of NA observations in series.

start

Start date.

end

End date.

name

Name of river.

na.info

Matrix containing the index and start date of all blocks of more than one NA observation.

Examples

data(sycamore)
sycamore.flows<-asStreamflow(sycamore,start.date="1965-01-01", 
                             end.date="2010-03-15",river.name="Sycamore Creek")

[Package discharge version 1.0.0 Index]