Retrieves an object from a robjgrader_records result and validates
it against a reference object, a set of named checks, or both.
Arguments
- records
A
robjgrader_recordsobject fromget_records().- name
Character. Variable name of the recorded object. Primary identification method.
- match
Named list of coarse matching criteria used when
nameis absent or unknown (e.g. student chose a different variable name, or the object was never assigned). Must includetype; all other keys are optional. Criteria are applied in order of discriminating power (most to least) until one candidate remains; a criterion that would eliminate all remaining candidates is skipped.Universal (all types):
typeRequired. One of
"ggplot","model","df","table".expr_containsCharacter. Fixed substring matched against the source expression text (e.g.
"filter(year == 2007)").
ggplot:
aes_x,aes_y,aes_color,aes_colour,aes_fill,aes_size,aes_shape,aes_alpha,aes_group,aes_linetypeCharacter. Expected variable name mapped to that aesthetic.
geomCharacter. Geom class name, either short (
"point") or full ("GeomPoint"). Matches if any layer uses that geom.facet_varCharacter vector. Variable name(s) that must appear in the facet specification.
model:
outcomeCharacter. Name of the response variable (LHS).
estimatorCharacter. Class the model must inherit from, e.g.
"lm","glm","fixest".predictorsCharacter vector. RHS variable names that must all be present in the model formula.
fixed_effectsCharacter vector. Fixed-effect variable names (relevant for fixest models).
clusterCharacter vector. Clustering variable names.
nobsInteger. Exact number of observations.
df:
namesCharacter vector. Column names that must all be present.
nrowInteger. Exact number of rows.
ncolInteger. Exact number of columns.
table:
expr_containsOnly
expr_containsis effective for tables; structural criteria are not yet supported.
- reference
Optional reference object. Serves two roles: (1) when neither
namenormatchis given, the reference is used to locate the best-matching candidate automatically by extracting structural criteria (type, aesthetics, model outcome, column names, etc.) and running them through the normal match logic; (2) when a candidate has been identified, the reference is used for group-level semantic comparison.- checks
Named list of type-specific property checks, or a character vector of group names to check against
reference.- exclude
Character vector of group names to skip when
referenceis provided. Individualchecksare unaffected.- position
Positional fallback when matching yields > 1 candidate:
"last"(default),"first", or an integer index among the filtered candidates.