date_seasons: Get the begin and end dates of seasons in seasonal time...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/date_seasons.R

Description

Getting the begin and end dates of seasons in seasonal time series such as rainfall data. When the rainy season is bimodal, for instance, the function detect the 2 seasons first, then return the begin and end dates of each.

Usage

1
2
3
4
5
6
7
date_seasons(x, ...)

## Default S3 method:
date_seasons(x, ...)

## S3 method for class 'seasons'
date_seasons(x, ...)

Arguments

x

A numeric vector or an object of class seasons

...

further argument to be passed to the class constructor function seasons (). Ignored when x is of class seasons.

Details

detecting the dates of the biginning and the end of the season is more likely to yield meaningful result when x has been derived via get_phases (x,..., returned = 'seasonal') which rescales the data to make more consistant ordering.

Value

The beginning and the end of the season.

Author(s)

Issoufou Liman

Issoufou Liman

See Also

phases, get_phases

Examples

1
2
3
4
5
6
7
8
nam<- seq.Date(from = as.Date('2016-01-01'), to = as.Date ('2018-12-31'), by = 16)
dy11 <- c(1.40, 1.00, 1.50, 2.00, 5.00, 3.00, 1.00, 0.76, 2.00, 1.00, 3.50, 3.00, 1.50)
dy12 <- c(1.30, 1.10, 1.40, 2.01, 5.50, 2.80, 1.01, 1, 2.03, 1.09, 3.10, 3.00, 1.50)
dy1 <- c(dy11, dy12)
names(dy1) <- nam[1:length(dy1)]

y <- get_phases (dy1, ts_freq = 12)
z <- lapply(y, date_seasons)

Issoufou-Liman/growingSeason documentation built on Jan. 23, 2020, 3:43 a.m.