Reads response data collected by the surveyframe Google Apps Script endpoint and returns a validated data frame ready for the surveyframe analysis pipeline.
Usage
read_sheet_responses(
sheet_id,
instrument,
sheet_name = "Responses",
respondent_id = "respondent_id",
submitted_at = "submitted_at",
meta_cols = NULL
)Arguments
- sheet_id
Character. The Google Sheet ID or full URL.
- instrument
An
sframeobject.- sheet_name
Character. The name of the sheet tab holding responses. Defaults to
"Responses".- respondent_id
Character or NULL. Column holding respondent IDs. Defaults to
"respondent_id".- submitted_at
Character or NULL. Column holding submission timestamps. Defaults to
"submitted_at".- meta_cols
Character vector or NULL. Additional sheet columns to accept as metadata without a warning, for example bridge fields a host application appends to each submission.
"started_at"is always included.
Value
A data.frame validated against the instrument, ready for
quality_report(), score_scales(), and reliability_report().
Examples
if (FALSE) { # \dontrun{
responses <- read_sheet_responses(
sheet_id = "your-sheet-id",
instrument = instr
)
qr <- quality_report(responses, instr, respondent_id = "respondent_id")
} # }