Generates a self-contained HTML report from the output of
run_analysis_plan(). Each section corresponds to one research question
and includes the APA-formatted statistical result, an interpretation space,
and a reference list.
Usage
render_results(
results = NULL,
instrument,
output_file = NULL,
output_path = NULL,
citation_format = c("apa", "ama", "vancouver"),
title = NULL,
interpretations = NULL
)Arguments
- results
An
sframe_analysis_resultsobject fromrun_analysis_plan().- instrument
An
sframeobject.- output_file
Character or NULL. Path to the output HTML file. When NULL, a temporary file is written and its path returned.
- output_path
Character or NULL. Alias for
output_file.- citation_format
Character. Reference format. One of
"apa","ama", or"vancouver". Defaults to"apa".- title
Character or NULL. Report title. Defaults to the instrument title with " – Results" appended.
- interpretations
Named list or NULL. Written interpretations keyed by analysis-plan block id, added after the results are known. A block with an entry shows that text in its Interpretation section in place of the pre-declared prompt fallback. Blocks without an entry render exactly as they do when this argument is NULL. Interpretations are report content only and are never written into the instrument.
Examples
instr <- read_sframe(
system.file("extdata", "tourism_services_demo.sframe",
package = "surveyframe")
)
responses <- read_responses(
system.file("extdata", "tourism_services_responses.csv",
package = "surveyframe"),
instr,
respondent_id = "respondent_id",
submitted_at = "submitted_at",
meta_cols = "started_at"
)
# \donttest{
results <- run_analysis_plan(responses, instr)
out <- render_results(results, instr,
output_file = tempfile(fileext = ".html"))
file.exists(out)
#> [1] TRUE
# }