rvn_wyear_indices {RavenR}R Documentation

Water Year Indices

Description

Returns the indices of the provided time series for the start/end of the water year. The month/day of the water year defaults to September 30 for an October 1 water year cycle. However, this may be supplied as other values, for example as June 30 for a July 1 water year (i.e. the Australian water year). This function is useful in supplying endpoints for water year evaluations.

Usage

rvn_wyear_indices(x, mm = 9, dd = 30)

Arguments

x

xts object or Date/POSITXtc series to obtain indices for

mm

month of water year (default 9)

dd

day of water year (default 30)

Details

Emulates the endpoints function for a water year period. The first and last points are included in all supplied endpoints, which may introduce partial periods to the analysis.

Value

ep

array of indices corresponding to start/end of water years

See Also

rvn_apply_wyearly to apply functions over the water year endpoints workhorse function for generating endpoints in xts for other periods

Examples


# read in sample forcings data
data(rvn_forcing_data)

# get the indices of the water year for October 1 (the default)
rvn_wyear_indices(rvn_forcing_data$forcings)
rvn_wyear_indices(rvn_forcing_data$forcings) %>%
rvn_forcing_data$forcings[., 1:2]

# get the indices of the start of the water year for July 1
## note that the last period is the last index, and not a complete water year period
rvn_wyear_indices(rvn_forcing_data$forcings, mm=6, dd=30) %>%
rvn_forcing_data$forcings[., 1:2]


[Package RavenR version 2.2.2 Index]