interpolate: Interpolate missing values

interpolate.mdl_dfR Documentation

Interpolate missing values

Description

Uses a fitted model to interpolate missing values from a dataset.

Usage

## S3 method for class 'mdl_df'
interpolate(object, new_data, ...)

## S3 method for class 'mdl_ts'
interpolate(object, new_data, ...)

Arguments

object

A mable containing a single model column.

new_data

A dataset with the same structure as the data used to fit the model.

...

Other arguments passed to interpolate methods.

Examples


library(fable)
library(tsibbledata)

# The fastest running times for the olympics are missing for years during 
# world wars as the olympics were not held.
olympic_running

olympic_running %>% 
  model(TSLM(Time ~ trend())) %>% 
  interpolate(olympic_running)


tidyverts/fabletools documentation built on Feb. 7, 2025, 6:40 p.m.