seas
パッケージもチェックできます。
library(seas)
x <- c("19790304", "19790603", "19790903", "19791205")
x2 <- as.Date(x, format = "%Y%m%d")
# width = "JFM": annual quarterly divisions: JFM, AMJ, JAS, OND
x3 <- mkseas(x2, width = "JFM")
x3
# [1] JFM AMJ JAS OND
# if you wish to rename factor levels
x4 <- factor(x3, labels = c("winter", "spring", "summer", "autumn"))
x4
# [1] winter spring summer autumn
# alternative division
# width = "DJF": meteorological quarterly divisions: DJF, MAM, JJA, SON
x3 <- mkseas(x2, width = "DJF")
x3
# [1] MAM JJA SON DJF
x4 <- factor(x3, labels = c("winter", "spring", "summer", "autumn"))
x4
# [1] spring summer autumn winter