Data loading
Arguments
- datapath
path to the file with the data format as extracted from kobo with dot as group separator and xml header
Examples
datalist <- kobo_data(datapath = system.file("data.xlsx", package = "kobocruncher") )
# MainFrame
datalist[["main"]]
#> # A tibble: 5 × 26
#> start end location profile.country
#> <dttm> <dttm> <chr> <chr>
#> 1 2022-10-27 08:57:57 2022-11-10 08:49:09 private_facility VEN
#> 2 2022-10-24 11:36:52 2022-10-24 15:46:00 home HND
#> 3 2022-10-26 16:19:35 2022-10-26 18:15:07 subcenter SLV
#> 4 2022-10-26 16:19:35 2022-10-26 17:51:14 subcenter SLV
#> 5 2022-10-26 14:02:06 2022-10-26 16:10:25 home COL
#> # ℹ 22 more variables: profile.occupation <chr>, profile.reason <chr>,
#> # profile.reason.accomodation <dbl>, profile.reason.employment <dbl>,
#> # profile.reason.education <dbl>, profile.reason.community <dbl>,
#> # profile.reason.safety <dbl>, profile.reason.movement <dbl>,
#> # profile.reason.reunification <dbl>, profile.reason.no_answer <dbl>,
#> # profile.reason.other <dbl>, profile.HHSize <dbl>, `_id` <dbl>,
#> # `_uuid` <chr>, `_submission_time` <dbl>, `_validation_status` <lgl>, …
# Second Frame - based on presence of repeat within the form, aka nested or
# hierarchical data structure, etc...
datalist[["members"]]
#> # A tibble: 12 × 14
#> members.age members.sex `_index` `_parent_table_name` `_parent_index`
#> <dbl> <chr> <dbl> <chr> <dbl>
#> 1 56 male 1 Sample Dataset KoboloadeR 1
#> 2 2 male 2 Sample Dataset KoboloadeR 2
#> 3 3 male 3 Sample Dataset KoboloadeR 2
#> 4 10 female 4 Sample Dataset KoboloadeR 2
#> 5 45 male 5 Sample Dataset KoboloadeR 2
#> 6 35 female 6 Sample Dataset KoboloadeR 2
#> 7 4 male 7 Sample Dataset KoboloadeR 3
#> 8 34 female 8 Sample Dataset KoboloadeR 3
#> 9 34 male 9 Sample Dataset KoboloadeR 3
#> 10 51 female 10 Sample Dataset KoboloadeR 4
#> 11 21 male 11 Sample Dataset KoboloadeR 5
#> 12 25 female 12 Sample Dataset KoboloadeR 5
#> # ℹ 9 more variables: `_submission__id` <dbl>, `_submission__uuid` <chr>,
#> # `_submission__submission_time` <dbl>,
#> # `_submission__validation_status` <lgl>, `_submission__notes` <lgl>,
#> # `_submission__status` <chr>, `_submission__submitted_by` <lgl>,
#> # `_submission__tags` <lgl>, parent_index <dbl>