season_flag: Season flag

View source: R/season_flag.R

season_flagR Documentation

Season flag

Description

Creates season, month, or quarter indicator from a time column. Useful for grouped analysis and preprocessing by season.

Usage

season_flag(data, date_col = NULL, type = c("season", "month", "quarter"),
            verbose = FALSE)

Arguments

data

A data frame with a time column.

date_col

Time column index or name. If NULL, the first column matching date is used.

type

Type of flag: "season" (winter, spring, summer, autumn), "month" (abbreviated month), or "quarter" (Q1-Q4).

verbose

Logical; if TRUE, prints progress message.

Value

A character vector or factor containing the requested flag.

Examples

season_flag(data[1:200, c(1, 4, 17:19)], date_col = 1, type = "season")

dataprep documentation built on Oct. 1, 2026, 5:07 p.m.