Skip to contents

Review if there are duplication of kobo name and labels in the kobo tools

Usage

review_kobo_labels(
  kobo_survey_sheet,
  kobo_choices_sheet,
  label_column = "label::english",
  exclude_type = c("begin_group", "end_group", "beging_repeat", "end_repeat", "note"),
  results_table = NULL
)

Arguments

kobo_survey_sheet

kobo survey sheet. It must contain type and name.

kobo_choices_sheet

kobo choices sheet. It must contain list_name and name.

label_column

Column name with the label to be used, default is "label::english"

exclude_type

Types to exclude in the review, default is c("begin_group", "end_group", "beging_repeat", "end_repeat", "note")

results_table

Results table with group_var and analysis_var columns (names of the different variables). The table will be used to review only the names and label that will appear.

Value

A data frame with the duplicated cases and the reasons. Empty if there is no duplication.

Examples

review_kobo_labels(
  kobo_survey_sheet = presentresults_MSNA2024_kobotool_template$kobo_survey,
  kobo_choices_sheet = presentresults_MSNA2024_kobotool_template$kobo_choices,
)
#> # A tibble: 24 × 5
#>    comments                               name  list_name `label::english`     n
#>    <chr>                                  <chr> <chr>     <chr>            <int>
#>  1 Kobo survey sheet has duplicated labe… NA    NA        1. Salaried work     2
#>  2 Kobo survey sheet has duplicated labe… NA    NA        10. Loans, supp…     2
#>  3 Kobo survey sheet has duplicated labe… NA    NA        11. Other (plea…     2
#>  4 Kobo survey sheet has duplicated labe… NA    NA        2. Casual or da…     2
#>  5 Kobo survey sheet has duplicated labe… NA    NA        3. Income from …     2
#>  6 Kobo survey sheet has duplicated labe… NA    NA        4. Income from …     2
#>  7 Kobo survey sheet has duplicated labe… NA    NA        5. Government s…     2
#>  8 Kobo survey sheet has duplicated labe… NA    NA        6. Income from …     2
#>  9 Kobo survey sheet has duplicated labe… NA    NA        7. Remittances       2
#> 10 Kobo survey sheet has duplicated labe… NA    NA        8. Humanitarian…     2
#> # ℹ 14 more rows
review_kobo_labels(
  kobo_survey_sheet = presentresults_MSNA2024_kobotool_template$kobo_survey,
  kobo_choices_sheet = presentresults_MSNA2024_kobotool_template$kobo_choices,
  results_table = presentresults_MSNA2024_results_table
)
#> # A tibble: 9 × 5
#>   comments                                name  list_name `label::english`     n
#>   <chr>                                   <chr> <chr>     <chr>            <int>
#> 1 Kobo survey sheet has duplicated label… NA    NA        How often did t…     3
#> 2 Kobo choices sheet has duplicated name… none  l_snfi_s… NA                   2
#> 3 Kobo choices sheet has duplicated name… surf… l_wash_d… NA                   2
#> 4 Kobo choices sheet has duplicated labe… NA    l_admin1  To be updated b…     2
#> 5 Kobo choices sheet has duplicated labe… NA    l_admin2  To be updated b…     3
#> 6 Kobo choices sheet has duplicated labe… NA    l_admin3  To be updated b…     4
#> 7 Kobo choices sheet has duplicated labe… NA    l_admin4  To be updated b…     4
#> 8 Kobo choices sheet has duplicated labe… NA    l_cluste… To be updated b…     4
#> 9 Kobo choices sheet has duplicated labe… NA    l_edu_le… To be updated b…     5