The goal of KoboconnectR is to facilitate data extraction from Kobotoolbox projects/assets into R, instead of downloading the individual spreadsheet files.
CRAN version can be downloaded with:
install.packages("KoboconnectR")
The effort is still in its early stage. The development version can be installed from GitHub with:
# install.packages("devtools")
devtools::install_github("asitav-sen/KoboconnectR")
Before being able to use the kobotoolbox API, one needs to set up API
token. The kobotoolbox
documentation lists multiple
ways for one to extract the token value. If there is a token, the
easiest way to retrieve it is by using get_kobo_token()
function.
kobotools_kpi_data(assetid= "assetid", url="kobo.humanitarianresponse.info", uname="username", pwd="password")
To find the asset id, one can use the kobotools_api()
function that
returns a list of assets the user has access to.
kobotools_api(url="kobo.humanitarianresponse.info", simplified=T, uname="userid", pwd="password")
KoboconnectR::kobo_df_download(uname = "username",
pwd="password", assetid = "assetid",
lang = "English (en)", all="false", lang="_default",
hierarchy="false", include_grp="true",grp_sep="/",fsep=";",
multi_sel="both", media_url="true", fields=NULL, sub_ids=NULL, sleep=2)
IF THE DOWNLOAD FAILS, TRY INCREASING THE SLEEP
PARAMETER (use the
dev version please).
For further details, check the vignette.
The package is stable but still in early stages of development. Any help to enhance it further will be highly appreciated. Please feel free to fork, add/modify and create pull requests.
Please feel free to add issue of suggestions in github
The following packages are required to install and run this package.
httr
jsonlite
curl
mime
openssl
R6
methods
readxl
rlang
purrr
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.