cut_seasonyear: Cut seasons, keep years together

View source: R/cutfuns.R

cut_seasonyearR Documentation

Cut seasons, keep years together

Description

Cut the data in year-season intervals while keeping the seasons together. This means december will be added to the following year.

With label = "year" only the year will be adjustet.

Usage

cut_seasonyear(x, label = c("yearseason", "year"), labels = NULL)

Arguments

x

a date-time vector

label

choice between c("yearseason", "year"). "yearseason" will combine the year and the output from cut_season(), "year" will return only the adjusted year.

labels

forwarded to cut_season()

Value

factor of yearseasons

Examples

dates <- lubridate::ymd(010101) + months(0:11)

cut_seasonyear(dates)

cut_seasonyear(dates, "year")

# customize season labels
labels =  c(
  DJF = "winter", JJA = "summer",
  MAM = "spring", SON = "autumn"
)

cut_seasonyear(dates, labels = labels)

Ostluft/rOstluft.plot documentation built on Jan. 26, 2025, 1:05 a.m.