Construct a visibility rule
visibility_rule.RdA rule is a closure, not a table, and it is split into fit and predict.
The split is what lets one interface cover exact derivation, donor means and
(later) a fitted model, and what makes correct bootstrapping possible: a rule
whose fit step consumes the sample must be refit inside each bootstrap
replicate, and one whose does not must not be.
Arguments
- label
short string naming the rule; appears in provenance output
- requires
character vector of columns the rule needs, checked up front
- is_estimated
TRUEiffit()consumes the sample. Drives the bootstrap path: seeapply_visibility_rule()- fit
function(donor.dat, weights)returning opaque state- predict
function(alter.rows, state)returning one row per row ofalter.rows, with columnsvis,vis_weightandvis_rule- assumptions
character vector of assumptions this rule makes, carried into the provenance table so they reach output rather than living only in a methods appendix
- params
list of the constructor's arguments, for printing