mock_spec_formula() describes a variable computed from other generated
variables by evaluating an algebraic expression (a mockFormula), rather
than sampled from a distribution. Evaluation happens in a restricted
environment exposing only the generated columns and a fixed allow-list of
base functions; see evaluate_mock_formulas().
Arguments
- name
Variable name.
- formula
Character scalar. An algebraic expression over other variable names, e.g.
"weight / (height^2)".- rtype
R output type for the computed column. Defaults to
"double".- missing_codes, missing_proportions, garbage_rules, provenance, model_hint
As for other variable specifications; applied by post-processing.
See also
mock_formula(), evaluate_mock_formulas()
Other mock specification APIs:
mock_spec(),
mock_spec_categorical(),
mock_spec_continuous(),
mock_spec_date(),
mock_spec_from_recodeflow(),
mock_spec_survival()