unhcr / koboloadeR

deprecated please use {kobocruncher} - https://edouard-legoupil.github.io/kobocruncher/
https://unhcr.github.io/koboloadeR/docs/
28 stars 28 forks source link

Problems with kobo_load_data function #80

Open DesertRatilla opened 3 years ago

DesertRatilla commented 3 years ago

Please briefly describe your context, your problem and what output you expect.

Please include if possible a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Context

I am using kobotoolbox to collect household level data on a daily basis to inform a Community based Surveillance System. If a household member gets sick, his/her symptoms are entered using a "Repeat"-type module. Similarly, if a household member gives birth, data related to this birth is entered using a "Repeat"-type module.

Problem

I use the kobo toolbox online interface to download the hierarchical data in csv files per module (as in https://unhcr.github.io/koboloadeR/docs/articles/Getting_data.html#using-the-online-interface-1). I create instanceID variable in all csv files. When I use the kobo_load_data function it never loads any of the "repeat"-type modules.

Current result

The log says :

loading Birth_report file .. [1] "There was an error in the data processing step!!! \n\n" $message [1] "unused argument (stringsAsFactors = F)"

$call readr::read_csv(paste0(mainDir, "/data-raw/", configInfoOrigin[configInfoOrigin$name == dbr, "path"]), stringsAsFactors = F)

attr(,"class") [1] "try-error"

Possible Fix

I think maybe it has to do with the fact that for some households there are not any sick members or births to report, and maybe that is causing problems when loading the data, but I cannot find the reason nor how to fix it. Thanks