always_zero_dates: Find calendar dates that are always zero or missing

View source: R/contingency.R

always_zero_datesR Documentation

Find calendar dates that are always zero or missing

Description

Calendar dates (month-day) that are zero or missing in every year present – these look like de facto holidays/closures that were never declared, so a holiday-aware model can't account for them.

Usage

always_zero_dates(data, holidays = NULL)

Arguments

data

A tibble with ds/y columns, the finalized dataset.

holidays

Optional tibble with a ds column, the compiled holiday list – used only to flag which suspicious dates are already declared.

Value

A tibble with columns ds, flag ("Zero every year" or "Missing every year"), and declared_holiday (logical) – the undeclared rows are the actual gap.

Examples

data <- tibble::tibble(
  ds = c(as.Date("2023-01-01"), as.Date("2024-01-01"), as.Date("2023-06-01")),
  y = c(0, 0, 5)
)
always_zero_dates(data)

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.