Gets the metereological season of a date or date-time object. Days in December belong to the summer of the next year. For example December 24, 2010 belongs to summer 2011.
get_season(x, with_year = TRUE)
x | a date-time object of class POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, fts or anything else that can be converted with as.POSIXlt |
---|---|
with_year | logical indicating whether or not to include the season's year/ |
a string with the season or the year and the season
#> [1] "2010.summer" "2010.summer" "2010.autumn" "2010.autumn" "2010.autumn" #> [6] "2010.winter" "2010.winter" "2010.winter" "2010.spring" "2010.spring" #> [11] "2010.spring" "2011.summer" "2011.summer" "2011.summer" "2011.autumn" #> [16] "2011.autumn" "2011.autumn" "2011.winter" "2011.winter" "2011.winter" #> [21] "2011.spring" "2011.spring" "2011.spring" "2012.summer" "2012.summer"get_season(x, with_year = FALSE)#> [1] "summer" "summer" "autumn" "autumn" "autumn" "winter" "winter" "winter" #> [9] "spring" "spring" "spring" "summer" "summer" "summer" "autumn" "autumn" #> [17] "autumn" "winter" "winter" "winter" "spring" "spring" "spring" "summer" #> [25] "summer"