csm_get_at_t: Linearly interpolate a time-varying variable at specific time...

View source: R/helper_functions.R

csm_get_at_tR Documentation

Linearly interpolate a time-varying variable at specific time point

Description

Linearly interpolate a time-varying variable at specific time point

Usage

csm_get_at_t(
  x,
  t_ind,
  t,
  method = "linear",
  search = c("interpolation", "bisection", "bruteforce", "i=t+1")
)

Arguments

x

a vector of a time-varying values for which to interpolate

t_ind

a vector of times corresponding to the values in x

t

a single time point at which to return a value

method

a string indicating what method to use for interpolation. One of: "linear"

search

a string indicating what method to use for finding the correct indices within t_ind. One of: "bisection", "interpolation"

Value

the numeric value of the time-varying variable interpolated at time t


csmbuilder documentation built on Sept. 19, 2026, 1:06 a.m.