An overview of the number of rows and groups, and of the durations participants needed to respond (if those data are available).
codebook_survey_overview(results, survey_repetition = "single", indent = "##")
results | a data frame which has the following columns: session, created, modified, expired, ended |
---|---|
survey_repetition | defaults to single (other values: repeated_once, repeated_many). controls whether internal consistency, retest reliability or multilevel reliability is computed |
indent | add # to this to make the headings in the components lower-level. defaults to beginning at h2 |
#> #> #> ### Survey overview #> #> 28 completed rows, 28 who entered any information, 0 only viewed the first page. There are 0 expired rows (people who did not finish filling out in the requested time frame). In total, there are 28 rows including unfinished and expired rows. #> #> #> There were 28 unique participants, of which 28 finished filling out at least one survey. #> #> This survey was not repeated. #> #> #> #> #> #> ```r #> if (survey_repetition != "single") { #> overview = results %>% dplyr::group_by(session) %>% #> dplyr::summarise( #> n = sum(!is.na(session)), #> expired = sum(!is.na(expired)), #> ended = sum(!is.na(ended)) #> ) %>% #> tidyr::gather(key, value, -session) #> if (length(unique(dplyr::filter(overview, key == "expired")$value)) == 1) { #> overview = dplyr::filter(overview, key != "expired") #> } #> print( #> ggplot2::ggplot(overview, ggplot2::aes(value, ..count..)) + ggplot2::geom_bar() + ggplot2::facet_wrap(~ key, nrow = 1) #> ) #> } #> ``` #> #> The first session started on 2016-07-08 09:54:16, the last session on 2016-11-02 21:19:50. #> #> #> #> ```r #> ggplot2::qplot(results$created) + ggplot2::scale_x_datetime("Date/time when survey was started") #> ``` #> #> ``` #> ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. #> ``` #> #>  #> #> People took on average 127.36 minutes (median 1.48) to answer the survey. #> #> #> ```r #> if (low_vals == 0) { #> warning("Durations below 0 detected.") #> } #> ``` #> #> ``` #> ## Warning: Durations below 0 detected. #> ``` #> #> ```r #> ggplot2::qplot(duration$duration, binwidth = 0.5) + ggplot2::scale_x_continuous(paste("Duration (in minutes), excluding", high_vals, "values above median + 4*MAD"), limits = c(lower_limit, upper_limit)) #> ``` #> #> ``` #> ## Warning: Removed 4 rows containing non-finite values (stat_bin). #> ``` #> #> ``` #> ## Warning: Removed 2 rows containing missing values (geom_bar). #> ``` #> #>  #>