Every surveyframe class returns its primary table, and each class has its
own columns. Where an object holds more than one table, the others are
reachable through the named accessors in sframe_accessors, or, for a full
tabular record of an instrument, through sframe_codebook().
What each class gives
sframe: one row per item, withid,label,type,choice_set,scale_id,reverseandrequired.sframe_codebook: one row per item, the codebook's item table.sframe_validation: one row per problem, withcheckandproblem.sframe_analysis_results: one row per block, withblock,research_question,methodandapa.sframe_reliability_report: one row per scale, withscale_id,label,n_items,n,alphaandomega.sframe_item_report: one row per item, withscale_idand the item diagnostics.sframe_quality_report: one row per check, the flattened quality checks.sframe_efa_report: one row per measure, the readiness measures.sframe_sensitivity: one row per perturbation, withcriterion,direction,weight,rho,rank_changedandtop_changed.
A summary, and where the full record is
These tables are a summary of the columns a reader scans first. The item
table leaves out help text, placeholder, matrix rows, comparison items and
scale, slider and rating settings, date bounds, section introduction and
page. The scale table leaves out min_valid, the reverse key and the
weights. Read the stored declaration in full through sframe_get_items(),
sframe_get_scales() and the rest of sframe_accessors, each of which returns the
component objects themselves, or through write_sframe() for the
interchange record.
A class holding one table returns it directly, so it keeps that table's own
row names and row.names has no effect. Pass row.names to
base::as.data.frame() on the returned frame where you need to set them.
The coercion gives one view of an object. An instrument, for example,
returns its items, and its choice sets and scales come from
sframe_get_choice_sets(), sframe_get_scales() or sframe_codebook().
See also
sframe_accessors, sframe_codebook()
Other Inspect functions:
as.data.frame.sf_choices(),
as.data.frame.sframe(),
as.data.frame.sframe_analysis_results(),
as.data.frame.sframe_assumption_report(),
as.data.frame.sframe_codebook(),
as.data.frame.sframe_descriptives_report(),
as.data.frame.sframe_efa_report(),
as.data.frame.sframe_efa_solution(),
as.data.frame.sframe_item_report(),
as.data.frame.sframe_missing_data_report(),
as.data.frame.sframe_quality_report(),
as.data.frame.sframe_reliability_report(),
as.data.frame.sframe_sample_size_plan(),
as.data.frame.sframe_sensitivity(),
as.data.frame.sframe_validation(),
as.data.frame.sframe_validity_report(),
sf_component_list,
sframe_accessors,
sframe_apa(),
sframe_flagged(),
sframe_get_attention_checks(),
sframe_get_branches(),
sframe_get_choice_sets(),
sframe_get_items(),
sframe_get_models(),
sframe_get_scales(),
sframe_id(),
sframe_identity,
sframe_is_valid(),
sframe_label(),
sframe_meta(),
sframe_missing_columns(),
sframe_notes(),
sframe_object(),
sframe_problems(),
sframe_report_accessors,
sframe_subset,
sframe_validation_accessors
Examples
cs <- sframe_choice_set("ag5", 1:5,
c("Strongly disagree", "Disagree", "Neutral",
"Agree", "Strongly agree"))
item <- sframe_item("sat_1", "The service met my expectations.",
type = "likert", choice_set = "ag5", scale_id = "sat")
scale <- sframe_scale("sat", "Satisfaction", items = "sat_1")
instr <- sframe_instrument("Demo Survey", components = list(cs, item, scale))
as.data.frame(instr)
as.data.frame(cs)