Learn R Programming

refund (version 0.1-40)

resolve_effect: Resolve an effect specification to a coefficient function/matrix

Description

Accept a preset string, custom function, or list with parameters, and return the evaluated coefficient function/matrix.

Usage

resolve_effect(
  spec,
  term_type,
  xind = NULL,
  yind = NULL,
  random_generator = NULL
)

Value

Evaluated coefficient: matrix for ff/smooth terms, vector for others.

Arguments

spec

Effect specification: a string (preset name), function, numeric, or list with `fun` and additional parameters. The special preset `"random"` uses the random_generator to create reproducible random effects.

term_type

Character string: one of "ff", "smooth", "const", "intercept", "linear", or "concurrent".

xind

Numeric vector of x evaluation points (for ff terms).

yind

Numeric vector of y (response) evaluation points.

random_generator

Optional random truth generator from [make_random_truth_generator()], required when spec = "random".