convert_months_to_horizon: Convert a forecast horizon in months to periods

View source: R/horizon_utils.R

convert_months_to_horizonR Documentation

Convert a forecast horizon in months to periods

Description

Convert a forecast horizon in months to periods

Usage

convert_months_to_horizon(months, aggregation)

Arguments

months

Numeric, the horizon in months (as set by the app's "Forecast Horizon (months)" slider).

aggregation

One of "hour", "day", "week", "month", "quarter", "year" – the series' aggregation frequency.

Value

A numeric horizon in the same units as aggregation (e.g. days, for aggregation = "day"), suitable for a model's forecast(model, h) call.

Examples

convert_months_to_horizon(12, "day")
convert_months_to_horizon(12, "month")

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