is_forecast: Test whether an object is a forecast object

is_forecastR Documentation

Test whether an object is a forecast object

Description

Test whether an object is a forecast object (see as_forecast() for more information).

You can test for a specific ⁠forecast_*⁠ class using the appropriate ⁠is_forecast_*⁠ function.

Usage

is_forecast(x)

is_forecast_sample(x)

is_forecast_binary(x)

is_forecast_point(x)

is_forecast_quantile(x)

is_forecast_nominal(x)

Arguments

x

An R object.

Value

is_forecast: TRUE if the object is of class forecast, FALSE otherwise.

⁠is_forecast_<type>*⁠: TRUE if the object is of class ⁠forecast_*⁠ in addition to class forecast, FALSE otherwise.

Examples

forecast_binary <- as_forecast_binary(example_binary)
is_forecast(forecast_binary)

epiforecasts/scoringutils documentation built on Sept. 29, 2024, 4:30 p.m.