time2season {hydroTSM} | R Documentation |
Date/DateTime character -> Seasonal character
Description
This function transforms a character vector of Dates or DateTimes into a character vector of seasons (summer, winter, autumn, spring), depending on the value of type
:
When type=default
-) winter = DJF: December, January, February
-) spring = MAM: March, April, May
-) summer = JJA: June, July, August
-) autumn = SON: September, October, November
When type=FrenchPolynesia
-) winter = DJFM: December, January, February, March
-) spring = AM : April, May
-) summer = JJAS: June, July, August, September
-) autumn = ON : October, November
Usage
time2season(x, out.fmt = "months", type="default")
Arguments
x |
vector with the dates that have to be transformed. class(x) must be Date |
out.fmt |
character, indicating the format of the output seasons. Possible values are: |
type |
character, indicating which weather seasons will be used for computing the output. Possible values are: |
Value
character vector with the weather season to which each date in x
belongs
Note
Weather seasons corresponding to French Polynesia were defined following a comment from Lydie Sichoix
Author(s)
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
See Also
dm2seasonal
, seasonalfunction
, extract
, dip
, mip
Examples
## Sequence of daily dates between "1961-01-01" and "1961-12-31"
t <- dip("1961-01-01", "1961-12-31")
time2season(t)
## Sequence of monthly dates between "1961-01-01" and "1961-12-31"
t <- mip("1961-01-01", "1961-12-31")
time2season(t)
time2season(t, out.fmt="seasons")