dtt_season: Season

Description Usage Arguments Details Value Examples

Description

Returns an ordered factor of the user specified seasons.

Usage

1
2
dtt_season(x, seasons = c(Spring = 3L, Summer = 6L, Autumn = 9L, Winter =
  12L))

Arguments

x

A Date or POSIXct vector

seasons

A uniquely named integer vector of the first month of each season or a uniquely named Date vector of the first dayte of each season.

Details

If the first month of the first season isn't January (1L), then the last season is considered to wrap into the following year.

Value

An ordered factor of the seasons.

Examples

1
2
3
4
dates <- as.Date(c("2001-01-01", "2001-02-28", "2012-09-01", "2012-12-01"))
dtt_season(dates)
dtt_season(dates, season = c(Monsoon = 2L, `Dry Period` = 6L))
dtt_season(dates, season = c(First = dtt_date("1972-01-01"), Second = dtt_date("1972-06-01")))

poissonconsulting/dttr documentation built on Feb. 20, 2021, 12:18 a.m.