View source: R/ISOdate2winter.R
ISOdate2winter | R Documentation |
Takes any date in "POSIXct" fomat and convert it to a relative number to the mid of the winter period.
ISOdate2winter(Date, type = c("cos", "linear"))
Date |
POSIXct format date |
type |
if it is computed using a cosine function or linear. |
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.
numeric in (0,1)
date <- ISOdate(2019, 1:12, 15)
ISOdate2winter(date)
ISOdate2winter(date, 'linear')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.