Skip to contents

surveyframe draws in 3 ways, and which one fits depends on what you already hold.

From a report or a set of results

Every report that has a natural chart carries a plot() method, so a report draws without naming a helper:

  • plot(reliability_report(...)) draws one report.

  • plot(results) draws each block of an analysis that has a chart.

  • plot(results, which = "RQ1") selects one block by its ID.

This is the shortest route, and it is the one to reach for first.

From a helper, by what it takes

The helpers exist for assembling a custom report, where you need one chart on its own terms. They differ in what they accept and in what comes back.

A helper that finds nothing to draw returns NULL, so guard the result where a report has to keep rendering.

Integration helpers

sframe_draw_mosaic() and sframe_draw_likert_diverging() draw into an open device for the generated reports, and stay exported so those reports keep working. sframe_likert_scale_groups() finds the scales whose items share a choice set, which is how a report groups them. Take the results they draw from run_analysis_plan().