Apply a visibility rule to ego X alter X cell reports
apply_visibility_rule.RdValidates the rule's requires against the columns actually present, fits
the rule, predicts a visibility for every row, and returns both the values
and a provenance table describing how they were arrived at.
Usage
apply_visibility_rule(
rule,
esc.dat,
ego.dat = NULL,
sib.dat = NULL,
ego.id = ".ego.id",
frame.indicator = NULL,
weights = NULL,
ego.in.group = NULL,
tie = NULL
)Arguments
- rule
- esc.dat
ego X alter X cell reports, one row per report
- ego.dat
ego-level data, used as the donor frame when a rule asks for
donor = "egos". Needs ay.Fcolumn; if it has none andsib.datis supplied, one is derived- sib.dat
long-form alter data, used to derive
y.Fwhenesc.datorego.datlacks it- ego.id
name of the ego id column
- frame.indicator
name of the 0/1 frame membership column.
NULL(the default) takes it fromtie, falling back to".sib.in.F". Setting it here as well as on the tie is an error if the two disagree- weights
name of the column holding donor sampling weights
- ego.in.group
is ego a member of the group ego reports about? Governs how
y.Fis derived.NULL(the default) takes it fromtie, falling back toTRUE. Setting it here as well as on the tie is an error if the two disagree; the tie is where it belongs- tie
a
tie_config()saying what kind of tie these reports are about. Required whenruleassumes a tie structure —vis_from_clique()does — because applicability cannot be read off the data: on a tie that is not a clique the clique rule still returns a finite, plausible number, and it is wrong. A rule that makes no structural assumption, such asvis_from_donor(), needs notie. Whenruleis avis_coalesce()chain, tiers inapplicable totieare dropped, and named in the returned provenance.