These are the currently available evaluator-functions for tfd-objects, which control how the entries are inter-/extrapolated to previously unseen arg-values. They all are merely wrappers around zoo::na.fill(), zoo::na.approx(), etc... Note that these are not meant to be called directly -- they are internal functions used by tf_evaluate.tfd() to do its thing.

The list:

  • tf_approx_linear for linear interpolation without extrapolation (i.e., zoo::na.approx() with na.rm = FALSE) -- this is the default,

  • tf_approx_spline for cubic spline interpolation, (i.e., zoo::na.spline() with na.rm = FALSE),

  • tf_approx_none in order to not inter-/extrapolate ever (i.e., zoo::na.fill() with fill = NA)

  • tf_approx_fill_extend for linear interpolation and constant extrapolation (i.e., zoo::na.fill() with fill = "extend")

  • tf_approx_locf for "last observation carried forward" (i.e., zoo::na.locf() with na.rm = FALSE and

  • tf_approx_nocb for "next observation carried backward" (i.e., zoo::na.locf() with na.rm = FALSE, fromLast = TRUE).

For implementing your own, see source code of tidyfun:::zoo_wrapper.

tf_approx_linear(x, arg, evaluations)

tf_approx_spline(x, arg, evaluations)

tf_approx_none(x, arg, evaluations)

tf_approx_fill_extend(x, arg, evaluations)

tf_approx_locf(x, arg, evaluations)

tf_approx_nocb(x, arg, evaluations)



new arg values to tf_approximate the function for


the arg values of the evaluations


the function's values at arg

See also