tween_fill: Fill out missing values by interpolation

View source: R/tween_fill.R

tween_fillR Documentation

Fill out missing values by interpolation

Description

This tween fills out NA elements (or NULL elements if data is a list) by interpolating between the prior and next non-missing values.

Usage

tween_fill(data, ease)

Arguments

data

A data.frame or vector.

ease

A character vector giving valid easing functions. Recycled to match the ncol of data

Value

If data is a data.frame then a data.frame with the same columns. If data is a vector then a vector.

Examples

# Single vector
tween_fill(c(1, NA, NA, NA, NA, NA, 2, 6, NA, NA, NA, -2), 'cubic-in-out')

# Data frame
tween_fill(mtcars[c(1, NA, NA, NA, NA, 4, NA, NA, NA, 10), ], 'cubic-in')


tweenr documentation built on Sept. 6, 2022, 9:05 a.m.