Introducing the R package robotoolbox

Wow, congrats.

2 Likes

Awesome, thanks. You can reach me at “mail at ahmadoudicko dot com”

1 Like

awesome, thanks a lot. Great package, I am downloading all the surveys (over 50) every day like this (see below). Any ideas on how to automatically import numbers as numbers and not characters?

get data from KoBo server

token = “xxxxxxx”

kobo_setup(url = “https://kobo.humanitarianresponse.info”, token = token)
kobo_settings()

surveys ← kobo_asset_list()

for (i in 1:length(surveys$uid)) {

print(i)
tryCatch( {
xx=kobo_data(surveys$uid[i])
assign(surveys$name[i],xx,pos = “.GlobalEnv”)
}
, error = function(e) {an.error.occured <<- TRUE})

}

Hi @titeuf_community

Can you clarify, what do you mean importing numbers as numbers?

Thanks

1 Like

I mean with numbers “as numeric”, basically what this function does: as.numeric()… I mean this is probably not very related to your package but would be easier if I can directly set this while importing the data.

You have columns in your data that are supposed to be numbers but are characters ?

1 Like

@titeuf_community do you want select_one with values coded as integer to behave like numeric values in R ? Can you share your form and run str(data) with data being the associated data loaded in R.

1 Like

thank you for your answer. I have realized that I accidentally coded the “don’t know” with “dont_know” instead of a number. so everything fine, I am very sorry about this… :slight_smile:

1 Like

I’m glad you sorted it out. I made some minor changes recently, don’t hesitate to upgrade.
Feedbacks are welcome on the package and its overall usability.
Thanks

1 Like

Hi there. Thank you for this package. It’s very useful. Unfortunately, for “specify other” type of questions, don’t get downloaded. Is there a way to fix this? Thank you for your help

1 Like

Hi @smaz

Do you have a minimal xlsform I can use to check? I have never noticed it, but if we fix it, I’ll add it to the unit test.

Thanks,
Ahmadou

1 Like

Hi @dickoa has there been any changes to this. The installation of remotes have worked however I get error in loading “robotoolbox”

Find picture below

image

Hi @nattie
It looks like the installation failed for some reason. Can you re-start R or try to re-install, then re-install it, and paste the warnings/error you have (if any)?

remotes::install_github("dickoa/robotoolbox")

Best,

1 Like

Hi @dickoa, thank for your interesting package. I have a question. In your tutorial, the result will give a data frame include date format. But in my result, it doesn’t have date format. Which argument do I need to specify in your function to have date format, or I will have to transform the data manually after read data to R.
Cheers,
Manh

Hi @manh_nguyen

It should normally turn it into date, but it’ll be great if I can have a look at the format of your date.
Can you share the format? e.g also the part of the xlsform where we have the date.

1 Like

tmp_form.xlsx (16.7 KB)
thanks for your quick response. here is my form and below the screen shot of the data i read to R. even the first 2 columns are not in date format like your tutorial.

Can you re-install it the package, I just pushed some changes to have dates back.
Let me know if it works.
Best,

1 Like

Fantastic @dickoa. one more favor if you can set up for the select multiple question can be read in 1 single column.
Thank you a lot for saving my time working on Kobotoolbox.
Cheers,
Manh

1 Like

That something I would love to improve @manh_nguyen . For select multiple, what would be the ideal format, can you show me an example? Also for select_multiple I’m still trying to find the best way to have label/no label switch as in select_one

1 Like

Well. I’m not sure if my preference would be the same with others. When I export my data from kobo I always choose the option export select many question as single column as it reduces the size of my data as well.
About label/no labels, I don’t have any problems with that yet :wink:.