Survey Tools - Data cleaning procedures on open end variables
Source:R/srv_detect_openends.R
srv_clean_oe.Rdsrv_text_exact_match(): Extract respondent to pass open end check based on exact matching.srv_text_fuzzy_match(): Extract respondent to pass open end check based on fuzzy matching.srv_text_detect_gibberish(): Extract respondent to pass open end check based on gibberish test.
Usage
srv_text_exact_match(
data,
id = "response_id",
oe_correct = "att_open_text",
oe_typed = "m_att_open"
)
srv_text_fuzzy_match(
data,
id = "response_id",
oe_correct = "att_open_text",
oe_typed = "m_att_open",
str_dist = 2:5
)
srv_text_fuzzy_match_plot(data)
srv_text_fuzzy_match_result(data)
srv_text_finalize_fuzzy_match(data, f_method, f_dist)
srv_text_detect_gibberish(
data,
fuzzy_res = NULL,
oe_pattern = c("text", "open")
)
srv_extract_failed_oe_ids(data, id = "response_id")Arguments
- data
Dataframe/List.
For
srv_text_*_match(): Survey data containing correct and typed open end columns.For
srv_text_fuzzy_match_*(): Result fromsrv_text_fuzzy_match().For
srv_text_detect_gibberish(): Survey data containing all open end columns.For
srv_extract_failed_oe_ids(): Result fromsrv_text_detect_gibberish().
- id
Character. Column name that specifies respondent ID.
- oe_correct
Character. (Default =
att_open_text). The column indatawith the correct attention check responses.- oe_typed
Character. (Default =
att_open_text). The column indatathat was used to capture participants attention.- str_dist
Integer. String distance to use for joining.
- f_method
Character. What method did you decide on?
- f_dist
Integer. What distance did you decide on?
- fuzzy_res
Dataframe. Output from
srv_text_finalize_fuzzy_match()- oe_pattern
Character. Pattern to catch open ended variables in
data.
Value
srv_text_exact_match(): Dataframe of respondents that passed this check.srv_text_fuzzy_match(): Dataframe of respondents that passed this check for various combination of string distance methods and distance.srv_text_fuzzy_match_plot(): A ggplot2 object.srv_text_fuzzy_match_result(): List of dataframes for every method and string distance used.srv_text_finalize_fuzzy_match(): Dataframe for the specific method and string distance chosen.srv_text_detect_gibberish(): Dataframe of respondents who passed/failed gibbersh checks.srv_extract_failed_oe_ids(): Extract the IDs of the responses that failed the gibberish test by pulling all IDs marked "Y" in the "Passed" tab and those not marked "Y" in the "Failed" tab of the output of thesrv_text_detect_gibberish()function.
Examples
data(ds_newsletter_oe)
## Perform exact match
srv_text_exact_match(ds_newsletter_oe)
#> ℹ 71/100 respondents passed the exatch match test!
#> # A tibble: 71 × 3
#> response_id correct_oe_var typed_oe_var
#> <chr> <chr> <chr>
#> 1 R_U9FsWwMKk09TzFL the quick brown fox jumps over a lazy dog the quick brown …
#> 2 R_RDKRvPdnVrT6FWN a picture is worth a thousand words a picture is wor…
#> 3 R_1mDyfhjz05cNVgO a picture is worth a thousand words a picture is wor…
#> 4 R_2dAS3IeHAqYSdbq the quick brown fox jumps over a lazy dog the quick brown …
#> 5 R_2ydCQT5BWua5ksB a picture is worth a thousand words a picture is wor…
#> 6 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps over a lazy dog the quick brown …
#> 7 R_pG9UWihD4LTLU4h the quick brown fox jumps over a lazy dog the quick brown …
#> 8 R_1dmCpDtEle8pnji a picture is worth a thousand words a picture is wor…
#> 9 R_1EhY1Up0R4YQpcb the quick brown fox jumps over a lazy dog the quick brown …
#> 10 R_tPZd4fJjhMapoHv the quick brown fox jumps over a lazy dog the quick brown …
#> # ℹ 61 more rows
## Create fuzzy match setup
res <- srv_text_fuzzy_match(ds_newsletter_oe)
## Summarize result with a plot
srv_text_fuzzy_match_plot(res)
#> copying font files to ~/.local/share/fonts : AnekLatin
#> copying font files to ~/.local/share/fonts : IBMPlexMono
#> copying font files to ~/.local/share/fonts : IBMPlexSans
#> copying font files to ~/.local/share/fonts : Lato
#> copying font files to ~/.local/share/fonts : OpenSans
#> copying font files to ~/.local/share/fonts : Raleway
#>
#> [!] You may need to restart the session (Ctrl + Shift + F10) to make the fonts work.
#> Warning: No color scale provided. Defaulting to g6tr colors
## Get raw results
srv_text_fuzzy_match_result(res)
#> $`dl - 2`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 dl - 2 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 dl - 2 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 dl - 2 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 dl - 2 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 dl - 2 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 dl - 2 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 dl - 2 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 dl - 2 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 dl - 2 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 dl - 2 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`dl - 3`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 dl - 3 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 dl - 3 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 dl - 3 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 dl - 3 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 dl - 3 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 dl - 3 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 dl - 3 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 dl - 3 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 dl - 3 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 dl - 3 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`dl - 4`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 dl - 4 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 dl - 4 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 dl - 4 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 dl - 4 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 dl - 4 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 dl - 4 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 dl - 4 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 dl - 4 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 dl - 4 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 dl - 4 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`dl - 5`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 dl - 5 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 dl - 5 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 dl - 5 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 dl - 5 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 dl - 5 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 dl - 5 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 dl - 5 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 dl - 5 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 dl - 5 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 dl - 5 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lcs - 2`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lcs - 2 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 lcs - 2 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 lcs - 2 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 33 FALSE
#> 4 lcs - 2 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 lcs - 2 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 lcs - 2 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 lcs - 2 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 lcs - 2 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 lcs - 2 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 lcs - 2 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lcs - 3`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lcs - 3 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 lcs - 3 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 lcs - 3 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 33 FALSE
#> 4 lcs - 3 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 lcs - 3 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 lcs - 3 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 lcs - 3 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 lcs - 3 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 lcs - 3 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 lcs - 3 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lcs - 4`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lcs - 4 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 lcs - 4 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 lcs - 4 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 33 FALSE
#> 4 lcs - 4 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 lcs - 4 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 lcs - 4 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 lcs - 4 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 lcs - 4 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 lcs - 4 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 lcs - 4 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lcs - 5`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lcs - 5 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 lcs - 5 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 lcs - 5 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 33 FALSE
#> 4 lcs - 5 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 lcs - 5 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 lcs - 5 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 lcs - 5 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 lcs - 5 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 lcs - 5 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 lcs - 5 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lv - 2`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lv - 2 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 lv - 2 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 lv - 2 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 lv - 2 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 lv - 2 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 lv - 2 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 lv - 2 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 lv - 2 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 lv - 2 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 lv - 2 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lv - 3`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lv - 3 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 lv - 3 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 lv - 3 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 lv - 3 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 lv - 3 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 lv - 3 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 lv - 3 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 lv - 3 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 lv - 3 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 lv - 3 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lv - 4`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lv - 4 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 lv - 4 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 lv - 4 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 lv - 4 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 lv - 4 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 lv - 4 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 lv - 4 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 lv - 4 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 lv - 4 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 lv - 4 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`lv - 5`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 lv - 5 R_397NGg5JN1ZCIDv the quick brown fox jumps … the quick b… 1 TRUE
#> 2 lv - 5 R_U9FsWwMKk09TzFL the quick brown fox jumps … the quick b… 0 TRUE
#> 3 lv - 5 R_C3wZCgumMSsLnaN don't judge a book by its … i never hea… 24 FALSE
#> 4 lv - 5 R_RDKRvPdnVrT6FWN a picture is worth a thous… a picture i… 0 TRUE
#> 5 lv - 5 R_29p0OJyQvQLEqHP don't judge a book by its … don't judge… 1 TRUE
#> 6 lv - 5 R_1mDyfhjz05cNVgO a picture is worth a thous… a picture i… 0 TRUE
#> 7 lv - 5 R_2dAS3IeHAqYSdbq the quick brown fox jumps … the quick b… 0 TRUE
#> 8 lv - 5 R_2ydCQT5BWua5ksB a picture is worth a thous… a picture i… 0 TRUE
#> 9 lv - 5 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps … the quick b… 0 TRUE
#> 10 lv - 5 R_pG9UWihD4LTLU4h the quick brown fox jumps … the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`osa - 2`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 osa - 2 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 osa - 2 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 osa - 2 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 24 FALSE
#> 4 osa - 2 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 osa - 2 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 osa - 2 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 osa - 2 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 osa - 2 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 osa - 2 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 osa - 2 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`osa - 3`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 osa - 3 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 osa - 3 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 osa - 3 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 24 FALSE
#> 4 osa - 3 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 osa - 3 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 osa - 3 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 osa - 3 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 osa - 3 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 osa - 3 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 osa - 3 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`osa - 4`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 osa - 4 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 osa - 4 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 osa - 4 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 24 FALSE
#> 4 osa - 4 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 osa - 4 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 osa - 4 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 osa - 4 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 osa - 4 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 osa - 4 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 osa - 4 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`osa - 5`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 osa - 5 R_397NGg5JN1ZCIDv the quick brown fox jumps… the quick b… 1 TRUE
#> 2 osa - 5 R_U9FsWwMKk09TzFL the quick brown fox jumps… the quick b… 0 TRUE
#> 3 osa - 5 R_C3wZCgumMSsLnaN don't judge a book by its… i never hea… 24 FALSE
#> 4 osa - 5 R_RDKRvPdnVrT6FWN a picture is worth a thou… a picture i… 0 TRUE
#> 5 osa - 5 R_29p0OJyQvQLEqHP don't judge a book by its… don't judge… 1 TRUE
#> 6 osa - 5 R_1mDyfhjz05cNVgO a picture is worth a thou… a picture i… 0 TRUE
#> 7 osa - 5 R_2dAS3IeHAqYSdbq the quick brown fox jumps… the quick b… 0 TRUE
#> 8 osa - 5 R_2ydCQT5BWua5ksB a picture is worth a thou… a picture i… 0 TRUE
#> 9 osa - 5 R_3Gp1Aa5Qljgnf84 the quick brown fox jumps… the quick b… 0 TRUE
#> 10 osa - 5 R_pG9UWihD4LTLU4h the quick brown fox jumps… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`qgram - 2`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 qgram - 2 R_397NGg5JN1ZCIDv the quick brown fox jum… the quick b… 1 TRUE
#> 2 qgram - 2 R_U9FsWwMKk09TzFL the quick brown fox jum… the quick b… 0 TRUE
#> 3 qgram - 2 R_C3wZCgumMSsLnaN don't judge a book by i… i never hea… 23 FALSE
#> 4 qgram - 2 R_RDKRvPdnVrT6FWN a picture is worth a th… a picture i… 0 TRUE
#> 5 qgram - 2 R_29p0OJyQvQLEqHP don't judge a book by i… don't judge… 1 TRUE
#> 6 qgram - 2 R_1mDyfhjz05cNVgO a picture is worth a th… a picture i… 0 TRUE
#> 7 qgram - 2 R_2dAS3IeHAqYSdbq the quick brown fox jum… the quick b… 0 TRUE
#> 8 qgram - 2 R_2ydCQT5BWua5ksB a picture is worth a th… a picture i… 0 TRUE
#> 9 qgram - 2 R_3Gp1Aa5Qljgnf84 the quick brown fox jum… the quick b… 0 TRUE
#> 10 qgram - 2 R_pG9UWihD4LTLU4h the quick brown fox jum… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`qgram - 3`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 qgram - 3 R_397NGg5JN1ZCIDv the quick brown fox jum… the quick b… 1 TRUE
#> 2 qgram - 3 R_U9FsWwMKk09TzFL the quick brown fox jum… the quick b… 0 TRUE
#> 3 qgram - 3 R_C3wZCgumMSsLnaN don't judge a book by i… i never hea… 23 FALSE
#> 4 qgram - 3 R_RDKRvPdnVrT6FWN a picture is worth a th… a picture i… 0 TRUE
#> 5 qgram - 3 R_29p0OJyQvQLEqHP don't judge a book by i… don't judge… 1 TRUE
#> 6 qgram - 3 R_1mDyfhjz05cNVgO a picture is worth a th… a picture i… 0 TRUE
#> 7 qgram - 3 R_2dAS3IeHAqYSdbq the quick brown fox jum… the quick b… 0 TRUE
#> 8 qgram - 3 R_2ydCQT5BWua5ksB a picture is worth a th… a picture i… 0 TRUE
#> 9 qgram - 3 R_3Gp1Aa5Qljgnf84 the quick brown fox jum… the quick b… 0 TRUE
#> 10 qgram - 3 R_pG9UWihD4LTLU4h the quick brown fox jum… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`qgram - 4`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 qgram - 4 R_397NGg5JN1ZCIDv the quick brown fox jum… the quick b… 1 TRUE
#> 2 qgram - 4 R_U9FsWwMKk09TzFL the quick brown fox jum… the quick b… 0 TRUE
#> 3 qgram - 4 R_C3wZCgumMSsLnaN don't judge a book by i… i never hea… 23 FALSE
#> 4 qgram - 4 R_RDKRvPdnVrT6FWN a picture is worth a th… a picture i… 0 TRUE
#> 5 qgram - 4 R_29p0OJyQvQLEqHP don't judge a book by i… don't judge… 1 TRUE
#> 6 qgram - 4 R_1mDyfhjz05cNVgO a picture is worth a th… a picture i… 0 TRUE
#> 7 qgram - 4 R_2dAS3IeHAqYSdbq the quick brown fox jum… the quick b… 0 TRUE
#> 8 qgram - 4 R_2ydCQT5BWua5ksB a picture is worth a th… a picture i… 0 TRUE
#> 9 qgram - 4 R_3Gp1Aa5Qljgnf84 the quick brown fox jum… the quick b… 0 TRUE
#> 10 qgram - 4 R_pG9UWihD4LTLU4h the quick brown fox jum… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
#> $`qgram - 5`
#> # A tibble: 100 × 6
#> type response_id correct_oe_var typed_oe_var dist match
#> <chr> <chr> <chr> <chr> <dbl> <lgl>
#> 1 qgram - 5 R_397NGg5JN1ZCIDv the quick brown fox jum… the quick b… 1 TRUE
#> 2 qgram - 5 R_U9FsWwMKk09TzFL the quick brown fox jum… the quick b… 0 TRUE
#> 3 qgram - 5 R_C3wZCgumMSsLnaN don't judge a book by i… i never hea… 23 FALSE
#> 4 qgram - 5 R_RDKRvPdnVrT6FWN a picture is worth a th… a picture i… 0 TRUE
#> 5 qgram - 5 R_29p0OJyQvQLEqHP don't judge a book by i… don't judge… 1 TRUE
#> 6 qgram - 5 R_1mDyfhjz05cNVgO a picture is worth a th… a picture i… 0 TRUE
#> 7 qgram - 5 R_2dAS3IeHAqYSdbq the quick brown fox jum… the quick b… 0 TRUE
#> 8 qgram - 5 R_2ydCQT5BWua5ksB a picture is worth a th… a picture i… 0 TRUE
#> 9 qgram - 5 R_3Gp1Aa5Qljgnf84 the quick brown fox jum… the quick b… 0 TRUE
#> 10 qgram - 5 R_pG9UWihD4LTLU4h the quick brown fox jum… the quick b… 0 TRUE
#> # ℹ 90 more rows
#>
## Finalize method and distance
oe_test <- srv_text_finalize_fuzzy_match(res, f_method = "osa", f_dist = 3)
## Detect gibberish
oe_gibber <- srv_text_detect_gibberish(ds_newsletter_oe, oe_test)
#> ℹ 2 variables matched for gibberish test!
## Get IDs that failed.
srv_extract_failed_oe_ids(oe_gibber)
#> [1] "R_3kNBd5kDHIaQXWA" "R_3KxfiZQUc5LViNd" "R_1js6bP7D2DVRECG"
#> [4] "R_1KxtYTCxKx49oDX"