new_forecast: Class constructor for 'forecast' objects

View source: R/forecast.R

new_forecastR Documentation

Class constructor for forecast objects

Description

Construct a class based on a data.frame or similar. The constructor

  • coerces the data into a data.table

  • makes sure that a column called model exists and if not creates one

  • assigns a class

Usage

new_forecast(data, classname)

Arguments

data

A data.frame (or similar) with predicted and observed values. See the details section of as_forecast() for additional information on required input formats.

classname

name of the class to be created

Value

An object of the class indicated by classname


epiforecasts/scoringutils documentation built on April 23, 2024, 4:56 p.m.