options(knitr.table.format = 'html') # work for pdf? webq_config(params$netid, params$key) ppts <- webq_participants(params$survey_id) resp <- webq_responses(params$survey_id, params$participant_ids) if(!is.null(params$question_ids)){ resp <- resp[resp$question_id %in% params$question_ids, ] }
for(participant_id in sort(unique(resp$participant_id))){ ppt_resp <- resp[resp$participant_id == participant_id, c('question_content', 'text_values', 'numeric_values')] ppt_resp <- ppt_resp[order(resp$question_id),] # sort by question ppt_resp <- ppt_resp[apply(ppt_resp, 1, function(x) !all(is.na(x))), ] # only display rows with data cat('<hr />') cat(paste0('\n## Participant: ', participant_id, '\n')) print( htmltools::HTML( kableExtra::kable_styling( knitr::kable(ppts[ppts$participant_id == participant_id, c('start_date', 'end_date')]) ) ) ) cat('<hr />') print( htmltools::HTML( kableExtra::kable_styling( knitr::kable( ppt_resp ) ) ) ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.