Skip to contents

Package developers register a function called with a freshly assembled rxUi before it is compressed. Use it to attach parse-time state to the model – for example values that a user-defined function (see rxUdfUi()) generated while the model was being parsed, which the rxUdfUi() return list has no field to carry.

Usage

rxRegisterUiAssembled(name, fn)

rxRemoveUiAssembled(name)

Arguments

name

Unique hook name; re-registering the same name replaces it.

fn

Function of one argument (the freshly assembled ui environment). The return value is ignored; errors are downgraded to a warning so a buggy hook cannot break unrelated model builds.

Value

Invisibly, the hook name (register) or NULL (remove).

Details

The hook receives the ui environment and may assign into it in place; pair that with the sticky mechanism (see rxForcedPars()) so the slot survives model piping and saveRDS(). A hook must not reorder rxModelVars(ui)$params, must be cheap, and must be a no-op for models it does not own.

Author

Matthew L. Fidler