ISOdate2winter: Convert date to winter relative pertain

View source: R/ISOdate2winter.R

ISOdate2winterR Documentation

Convert date to winter relative pertain

Description

Takes any date in "POSIXct" fomat and convert it to a relative number to the mid of the winter period.

Usage

ISOdate2winter(Date, type = c("cos", "linear"))

Arguments

Date

POSIXct format date

type

if it is computed using a cosine function or linear.

Details

consider the winter season in the northern hemisphere and compute a pertain function defined such that it will be near 1 in the center of the winter period and near zero in the center of the summer period. Considering meteorological seasons as: Winter 1 Dec to 28(29) Feb; Spring: 1 Mar to 31 May; Summer: 1 Jun to 31 Aug, Autumn: 1 Sep to 30 Nov. This definition of the seasons gives 0 around July 16 and 1 around January 15.

Value

numeric in (0,1)

Examples

date <- ISOdate(2019, 1:12, 15)
ISOdate2winter(date)
ISOdate2winter(date, 'linear')

eliaskrainski/emisc documentation built on Nov. 18, 2024, 11:02 a.m.