Learn R Programming

tf (version 0.3.4)

tf_evaluate: Evaluate tf-vectors for given argument values

Description

Also used internally by the [-operator for tf data (see ?tfbrackets) to evaluate object, see examples.

Usage

tf_evaluate(object, arg, ...)

# S3 method for default tf_evaluate(object, arg, ...)

# S3 method for tfd tf_evaluate(object, arg, evaluator = tf_evaluator(object), ...)

# S3 method for tfb tf_evaluate(object, arg, ...)

Value

A list of numeric vectors containing the function evaluations on arg.

Arguments

object

a tf, or a data.frame-like object with tf columns.

arg

optional evaluation grid (vector or list of vectors). Defaults to tf_arg(object), implicitly.

...

not used

evaluator

optional. The function to use for inter/extrapolating the tfd. Defaults to tf_evaluator(object). See e.g. tf_approx_linear() for details.

See Also

Other tidyfun inter/extrapolation functions: tf_approx_linear(), tf_interpolate()

Examples

Run this code
f <- tf_rgp(3, arg = seq(0, 1, length.out = 11))
tf_evaluate(f) |> str()
tf_evaluate(f, arg = 0.5) |> str()
# equivalent, as matrix:
f[, 0.5]
new_grid <- seq(0, 1, length.out = 6)
tf_evaluate(f, arg = new_grid) |> str()
# equivalent, as matrix:
f[, new_grid]

Run the code above in your browser using DataLab