Introducing the R package robotoolbox

Great work @dickoa, congrats! This package help me a lot.

2 Likes

Quick question… When importing data using kobo_data(), is there a way to specify that a specific variable should be imported as a character and not numeric? I ask because, in my data, I have a question where I ask my enumerators to report questions not answered by respondents and to separate those numbers by commas (,). So for example, if the respondent did not answer questions 2,3 and 4, the entry for this question would be (2,3,4). However, in the import, kobo_data() interprets this as a numeric question and drops the commas (,) so that in the import, this shows as 234.

1 Like

Hi @fodhiambo,

That’s an interesting use case, let me see what can be done. The data is pulled from the API in json format and then parsed into a data.frame in R. I’ll see if during the JSON to data.frame we can allow certain data to be as character.
I’ll need a minimal form to reproduce the behavior to work on a fix. I’ll come back to you ASAP

1 Like

@dickoa, of course. Let me know how I can be of help on this. I am a new user(just newly registered :slight_smile:) , so cannot upload an xls form. But you can download here >>> xls_form.xlsx - Google Sheets

Can you try the dev version and tell me if it works as expected now ?

# install.packages("pak")
pak::pkg_install("dickoa/robotoolbox")

Don’t forget to restart your session with the new version of robotoolbox.

1 Like

@dickoa, thanks for this update; the import behaves as expected now. Once again, thank you so much

2 Likes

Thanks @fodhiambo for raising this issue, it’ll make the package more robust.

2 Likes

Many thanks for this very useful package.
Are you planning a function to post via API .csv file(s) to the ‘media’ folder where Kobotoolbox stores data that is used in the survey form “pulldata” function?
Thanks for considering. Xavier

Thanks Xavier, in the dev version I started working on pull media files. I’ll see if I can add a function to push too. You’re the second person to ask this feature. I’ll see what I can do and thanks for feedback.

Best,
Ahmadou

1 Like

Many thanks for this. If you need someone to test the code I will be happy to do so.

With kind regards, Xavier

1 Like