Learn R Programming

FlowScreen (version 2.0)

Qn: Calculate flow quantiles

Description

This function calculates flow quantiles by hydrologic year, calendar year, month, or doy.

Usage

Qn(TS, n = 0.1, by = "hyear")

Value

Returns a numeric vector of the calculated flow quantile for the time periods indicated with the "by" argument. The "times" attribute contains the hydrologic year, calendar year, month, or day of year for each data point.

Arguments

TS

data.frame of streamflow time series loaded with read.flows.

n

Numeric value of the quantile. Default is 0.1.

by

Character string indicating time unit to summarize by. Default is "hyear" for hydrologic year, see create.ts. Other options are "year" for calendar year, "month", or "doy" for day of year.

Author

Jennifer Dierauer

Examples

Run this code
data(caniapiscau)
cania.ts <- create.ts(caniapiscau, hyrstart = 4)
cania.ts <- drop.years(cania.ts)
cania.ts <- set.plot.titles(cania.ts, 
title.elements = c("StationID", "StnName", "StateProv"))

# 50% quantile, i.e. mean, by calendar year
res <- Qn(cania.ts, n=0.5, by="year")
res2 <- screen.metric(res, ylabel = "Q (m3/s)")

# Default 10% quantile, by hydrologic year
res <- Qn(cania.ts)
res2 <- screen.metric(res, ylabel = "Q (m3/s)")

Run the code above in your browser using DataLab