sframe_validation is the diagnostic object returned by
validate_sframe() and validate_model(). It records whether the object
passed, every problem found, and every check that ran, including the checks
that found nothing.
Value
print() returns x invisibly. format() returns a single
character string. summary() returns the check table as a data frame.
as.data.frame() returns one row per problem.
Details
Use sf_is_valid() for the pass or fail flag, sf_problems() for the
messages, as.data.frame() for a problem-per-row table, summary() for
the full check roster, and as_sframe() to recover the validated
instrument.
Examples
cs <- sf_choices("ag5", 1:5,
c("Strongly disagree", "Disagree", "Neutral",
"Agree", "Strongly agree"))
item <- sf_item("sat_1", "The service met my expectations.",
type = "likert", choice_set = "ag5", scale_id = "sat")
scale <- sf_scale("sat", "Satisfaction", items = "sat_1")
instr <- sf_instrument("Demo Survey", components = list(cs, item, scale))
v <- validate_sframe(instr, strict = FALSE)
v
#> <sframe validation>
#> Instrument: Demo Survey (0.1.0)
#> Status: valid
#> Checks: 28 run, 0 with problems
sf_is_valid(v)
#> [1] TRUE
sf_problems(v)
#> character(0)
as.data.frame(v)
#> [1] check problem
#> <0 rows> (or 0-length row.names)
summary(v)
#> check status n_problems
#> 1 field_shapes ok 0
#> 2 duplicate_item_ids ok 0
#> 3 item_id_format ok 0
#> 4 duplicate_choice_ids ok 0
#> 5 choice_set_contents ok 0
#> 6 duplicate_scale_ids ok 0
#> 7 id_namespace ok 0
#> 8 item_config ok 0
#> 9 item_labels ok 0
#> 10 item_choice_set_refs ok 0
#> 11 item_scale_refs ok 0
#> 12 reverse_without_scale ok 0
#> 13 decision_item_shape ok 0
#> 14 comparison_scale ok 0
#> 15 scale_membership ok 0
#> 16 scale_parameters ok 0
#> 17 reverse_item_membership ok 0
#> 18 branching_refs ok 0
#> 19 branching_values ok 0
#> 20 check_refs ok 0
#> 21 duplicate_check_ids ok 0
#> 22 branch_targets ok 0
#> 23 analysis_plan_blocks ok 0
#> 24 analysis_plan_models ok 0
#> 25 analysis_plan_variables ok 0
#> 26 decision_scale_compatibility ok 0
#> 27 model_ids ok 0
#> 28 model_specs ok 0