Learn R Programming

fabletools (version 0.5.0)

interpolate.mdl_df: Interpolate missing values

Description

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

Usage

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

# S3 method for 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

Run this code
if (FALSE) { # requireNamespace("fable", quietly = TRUE)
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)
}

Run the code above in your browser using DataLab