interpolate_by_index: interpolate_by_index

View source: R/func_interpolate_by_index.R

interpolate_by_indexR Documentation

interpolate_by_index

Description

interpolates between a coloumn between a defined start and end index

Usage

interpolate_by_index(
  df,
  index_start,
  index_end,
  interp_col,
  index = "date",
  f = zoo::na.approx,
  extend = F
)

Arguments

index_start

value of index at begining of index. index must be unique. length must equal length(interp_col)

index_end

end of index value

interp_col

names of column, or vector of names to interpolate over

index

name of index column, default "date"

f

function to use for interpolation, default zoo::na.approx

d

dataframe to interpolate over

extrap

logical. when true, na.locf is applied to the whole interpolation column after the initial interpolation, expand the first and last values to the whole column

Author(s)

W. S. Drysdale


willdrysdale/wsdmiscr documentation built on Aug. 26, 2023, 12:31 a.m.