Skip to contents

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().

Value

A data frame, with the columns listed above for the class given.

What each class gives

  • sframe: one row per item, with id, label, type, choice_set, scale_id, reverse and required.

  • sframe_codebook: one row per item, the codebook's item table.

  • sframe_validation: one row per problem, with check and problem.

  • sframe_analysis_results: one row per block, with block, research_question, method and apa.

  • sframe_reliability_report: one row per scale, with scale_id, label, n_items, n, alpha and omega.

  • sframe_item_report: one row per item, with scale_id and 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, with criterion, direction, weight, rho, rank_changed and top_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().

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)