fill_from_past: Fill from past values

View source: R/timeseries.R

fill_from_pastR Documentation

Fill from past values

Description

If back index ( NA index - back) is lower than zero then the it is filled with the first value of the data frame. If the value in the back index is also NA, it iterates backwards until finding a non-NA value.

Usage

fill_from_past(tbl, colnames, back = 24)

Arguments

tbl

tibble or data.frame, with NA values in some columns

colnames

character or vector of characters, column names with NA values

back

integer, number of indices (rows) to go back and get the filling value

Value

tibble or data.frame


mcanigueral/dutils documentation built on Jan. 25, 2024, 3:34 p.m.