View source: R/render_survey.R
| render_survey | R Documentation |
Launches a Shiny survey with a welcome page, configurable header, all item types, branching logic, required-field enforcement, progress tracking, standard and conversational (one-question-at-a-time) display modes, and a customisable thank-you page. Responses can be persisted to CSV or passed to a callback.
render_survey(
instrument,
mode = c("shiny"),
title = NULL,
theme = NULL,
save_responses = c("none", "csv"),
output_path = NULL,
on_submit = NULL
)
instrument |
An |
mode |
Character. Deployment mode. Currently |
title |
Character or NULL. Override for the survey title. |
theme |
Character or NULL. Hex colour for the survey theme. |
save_responses |
Character. |
output_path |
Character or NULL. CSV path when |
on_submit |
Function or NULL. Callback receiving the submitted row. |
A shiny.appobj.
launch_studio(), read_responses()
cs <- sf_choices("ag5", 1:5,
c("Strongly disagree", "Disagree", "Neutral",
"Agree", "Strongly agree"))
item <- sf_item("sat_1", "How satisfied are you?",
type = "likert", choice_set = "ag5")
instr <- sf_instrument("My Survey", components = list(cs, item))
app <- render_survey(instr)
app <- render_survey(instr, save_responses = "csv", output_path = tempfile(fileext = ".csv"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.