ch_doys {CSHShydRology}R Documentation

Days of year and water year

Description

Converts an array of dates into a dataframe with date, year, month, doy, wyear, dowy.

The day of water year is computed from the first of the specified water year month.

Usage

ch_doys(Date, water_yr = 10)

Arguments

Date

an array of R dates, as produced by as.Date()

water_yr

the month starting the water year, default is 10 (October). If a value of 1 is specified, the 10 will be used.

Details

Converts a date array into a data frame with years, wateryears, and days of year and of water year.

Value

Returns a dataframe with date information:

Date

in Date format

year

numeric calendar year

month

number calendar month

doy

numeric day of year

wyear

numeric water year starting on day 1 of selected month

dwy

numeric day of water year

Author(s)

Paul Whitfield, Kevin Shook

Examples

dd <- seq.Date(as.Date("2010-01-01"), as.Date("2018-01-01"),by = 1)
output <- ch_doys(dd, water_yr=10)
head(output)


[Package CSHShydRology version 1.4.2 Index]