This function determines the season (Winter, Spring, Summer, or Fall) based on an input date.
Value
A factor indicating the season corresponding to the input date. The factor levels are:
"Winter" for December, January, and February.
"Spring" for March, April, and May.
"Summer" for June, July, and August.
"Fall" for September, October, and November.
"Undetermined" if the input is not a valid Date or POSIXct object or if the month is missing.
Details
The seasons are assigned based on geographic regions similar to how seasons occur in the United States.
The seasons are determined using the month of the year and the traditional meteorological definition of seasons (Winter: December, January, February; Spring: March, April, May; Summer: June, July, August; Fall: September, October, November).
Examples
# Example usage of the season function
season(as.Date("2025-01-15"))
#> [1] Winter
#> Levels: Winter
season(as.POSIXct("2025-07-01 12:00:00"))
#> [1] Summer
#> Levels: Summer