splityears: Split an XTS object into years

View source: R/splityears.r

splityearsR Documentation

Split an XTS object into years

Description

Split an xts object either into hydrological or calendar years.

Usage

splityears(x, type = "hydro")

Arguments

x

an xts object

type

String. Either 'hydro' for hydrological years or 'calendar' for splitting into calendar years

Details

Split an xts object into years. One can chose between hydrological years starting with October 1st or calendar years starting with January 1st.

Value

A list where each entry contains a single year

Author(s)

Simon Frey

See Also

yearplot

Examples

 
    # load runoff data
    data(runoff)
    summary(runoff)
    
    # split data into hydrological years
    x <- splityears(runoff)
    summary(x)
    
    # split data into calendar years
    x <- splityears(runoff, "calendar")
    summary(x)

freysimon/TigR documentation built on April 20, 2024, 9:28 p.m.