Skip to contents

get the correct frame for one selected variable - important when having variables within a repeat

Usage

kobo_frame(datalist, dico, var)

Arguments

datalist

An object of the "datalist" class as defined in kobocruncher

dico

An object of the "kobodico" class format as defined in kobocruncher

var

variable

Examples

dico <- kobo_dico( xlsformpath = system.file("sample_xlsform.xlsx", package = "kobocruncher") )
datalist <- kobo_data(datapath = system.file("data.xlsx", package = "kobocruncher") )

data <- kobo_frame(datalist = datalist,
                   dico = dico,
                   var = "members.sex"   )
knitr::kable(utils::head(data,5))
#> 
#> 
#> | members.age|members.sex | _index|_parent_table_name        | _parent_index| _submission__id|_submission__uuid                    | _submission__submission_time|_submission__validation_status |_submission__notes |_submission__status |_submission__submitted_by |_submission__tags | parent_index|X_id |
#> |-----------:|:-----------|------:|:-------------------------|-------------:|---------------:|:------------------------------------|----------------------------:|:------------------------------|:------------------|:-------------------|:-------------------------|:-----------------|------------:|:----|
#> |          56|male        |      1|Sample Dataset KoboloadeR |             1|        20759478|48cc75b7-3d86-4c3e-a99b-24b4032b7b9c |                     44685.89|NA                             |NA                 |submitted_via_web   |NA                        |NA                |            1|1    |
#> |           2|male        |      2|Sample Dataset KoboloadeR |             2|        20756978|f1c3d36c-3c25-4581-9f35-9c8ec405d744 |                     44685.84|NA                             |NA                 |submitted_via_web   |NA                        |NA                |            2|2    |
#> |           3|male        |      3|Sample Dataset KoboloadeR |             2|        20756978|f1c3d36c-3c25-4581-9f35-9c8ec405d744 |                     44685.84|NA                             |NA                 |submitted_via_web   |NA                        |NA                |            2|3    |
#> |          10|female      |      4|Sample Dataset KoboloadeR |             2|        20756978|f1c3d36c-3c25-4581-9f35-9c8ec405d744 |                     44685.84|NA                             |NA                 |submitted_via_web   |NA                        |NA                |            2|4    |
#> |          45|male        |      5|Sample Dataset KoboloadeR |             2|        20756978|f1c3d36c-3c25-4581-9f35-9c8ec405d744 |                     44685.84|NA                             |NA                 |submitted_via_web   |NA                        |NA                |            2|5    |