Package: ruODK 1.5.1

Florian W. Mayer

ruODK: An R Client for the ODK Central API

Access and tidy up data from the 'ODK Central' API. 'ODK Central' is a clearinghouse for digitally captured data using ODK <https://docs.getodk.org/central-intro/>. It manages user accounts and permissions, stores form definitions, and allows data collection clients like 'ODK Collect' to connect to it for form download and submission upload. The 'ODK Central' API is documented at <https://docs.getodk.org/central-api/>.

Authors:Florian W. Mayer [aut, cre], Maëlle Salmon [rev], Karissa Whiting [rev], Jason Taylor [rev], Marcelo Tyszler [ctb], Hélène Langet [ctb], DBCA [cph, fnd], NWSFTCP [fnd]

ruODK_1.5.1.tar.gz
ruODK_1.5.1.zip(r-4.5)ruODK_1.5.1.zip(r-4.4)ruODK_1.5.1.zip(r-4.3)
ruODK_1.5.1.tgz(r-4.5-any)ruODK_1.5.1.tgz(r-4.4-any)ruODK_1.5.1.tgz(r-4.3-any)
ruODK_1.5.1.tar.gz(r-4.5-noble)ruODK_1.5.1.tar.gz(r-4.4-noble)
ruODK_1.5.1.tgz(r-4.4-emscripten)ruODK_1.5.1.tgz(r-4.3-emscripten)
ruODK.pdf |ruODK.html
ruODK/json (API)
NEWS

# Install 'ruODK' in R:
install.packages('ruODK', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

Reviews:rOpenSci Software Review #335

Bug tracker:https://github.com/ropensci/ruodk/issues26 issues

Pkgdown site:https://docs.ropensci.org

Datasets:
  • fq_attachments - A tibble of submission attachments.
  • fq_data - Parsed submission data for an ODK Central form.
  • fq_data_strata - Parsed submission data for a subgroup of an ODK Central form.
  • fq_data_taxa - Parsed submission data for a subgroup of an ODK Central form.
  • fq_form_detail - A tibble of form metadata.
  • fq_form_list - A tibble of forms.
  • fq_form_schema - JSON form schema for an ODK Central form.
  • fq_form_xml - A nested list of a form definition.
  • fq_meta - OData metadata document for an ODK Central form.
  • fq_project_detail - A tibble of project metadata.
  • fq_project_list - A tibble of project metadata.
  • fq_raw - OData submission data for an ODK Central form.
  • fq_raw_strata - OData submission data for a subgroup of an ODK Central form.
  • fq_raw_taxa - OData submission data for a subgroup of an ODK Central form.
  • fq_submission_list - A tibble of submission metadata.
  • fq_submissions - A nested list of submission data.
  • fq_svc - OData service document for an ODK Central form.
  • fq_zip_data - A tibble of the main data table of records from a test form.
  • fq_zip_strata - A tibble of a repeated sub-group of records from a test form.
  • fq_zip_taxa - A tibble of a repeated sub-group of records from a test form.
  • fs_v7 - The parsed XML form_schema of a form from ODK Central v0.6.
  • fs_v7_raw - The unparsed XML form_schema of a form from ODK Central v0.6 as nested list.
  • geo_fs - The form_schema of a form containing geofields in GeoJSON.
  • geo_gj - The parsed submissions of a form containing geofields in GeoJSON.
  • geo_gj88 - The parsed submissions of a form containing geofields in GeoJSON with trailing empty coordinates present.
  • geo_gj_raw - The unparsed submissions of a form containing geofields in GeoJSON.
  • geo_wkt - The parsed submissions of a form containing geofields in WKT.
  • geo_wkt88 - The parsed submissions of a form containing geofields in WKT with trailing empty coordinates present.
  • geo_wkt_raw - The unparsed submissions of a form containing geofields in WKT.

On CRAN: no

Conda:

databaseopen-dataodkapidatadatasetodataodata-clientodk-centralopendatakit

7.73 score 42 stars 1 packages 57 scripts 96 exports 48 dependencies

Last updated 5 months agofrom:94345cd4f4 (on main). Checks:1 OK, 8 NOTE. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 14 2025
R-4.5-winNOTEMar 14 2025
R-4.5-macNOTEMar 14 2025
R-4.5-linuxNOTEMar 14 2025
R-4.4-winNOTEMar 14 2025
R-4.4-macNOTEMar 14 2025
R-4.4-linuxNOTEMar 14 2025
R-4.3-winNOTEMar 14 2025
R-4.3-macNOTEMar 14 2025

Exports:%>%attachment_getattachment_linkattachment_listaudit_getdrop_null_coordsencryption_key_listenexprenquoensymentity_auditsentity_changesentity_createentity_deleteentity_detailentity_listentity_updateentity_versionsentitylist_detailentitylist_downloadentitylist_listentitylist_updateexprexprsform_detailform_listform_schemaform_schema_extform_schema_parseform_xmlget_default_fidget_default_odkc_versionget_default_ordersget_default_pidget_default_ppget_default_pwget_default_tzget_default_unget_default_urlget_one_attachmentget_one_submissionget_one_submission_att_listget_one_submission_auditget_retriesget_ru_verboseget_test_fidget_test_fid_attget_test_fid_gapget_test_fid_wktget_test_fid_zipget_test_odkc_versionget_test_pidget_test_ppget_test_pwget_test_unget_test_urlhandle_ru_attachmentshandle_ru_datetimeshandle_ru_geopointshandle_ru_geoshapeshandle_ru_geotracesodata_entitylist_data_getodata_entitylist_metadata_getodata_entitylist_service_getodata_metadata_getodata_service_getodata_submission_getodata_submission_rectangleodata_svc_parseparse_odkc_versionproject_createproject_detailproject_listquoquo_namequosru_msg_abortru_msg_inforu_msg_noopru_msg_successru_msg_warnru_settingsru_setupsemver_gtsemver_ltsplit_geopointsplit_geoshapesplit_geotracesubmission_audit_getsubmission_detailsubmission_exportsubmission_getsubmission_listsymsymsuser_list

Dependencies:askpassassertthatbitbit64clicliprclisymbolscpp11crayoncurldplyrfansifsgenericsgluehmshttrjanitorjsonlitelifecyclelubridatemagrittrmimeopensslpillarpkgconfigprettyunitsprogresspurrrR6Rcppreadrrlangsemversnakecasestringistringrsystibbletidyrtidyselecttimechangetzdbutf8vctrsvroomwithrxml2

Accessing the OData API

Rendered fromodata-api.Rmdusingknitr::rmarkdownon Mar 14 2025.

Last update: 2024-10-11
Started: 2019-11-25

Accessing the RESTful API

Rendered fromrestful-api.Rmdusingknitr::rmarkdownon Mar 14 2025.

Last update: 2024-10-11
Started: 2019-11-25

Comparison of related software packages

Rendered fromcomparison.Rmdusingknitr::rmarkdownon Mar 14 2025.

Last update: 2024-10-11
Started: 2020-09-08

Setup

Rendered fromsetup.Rmdusingknitr::rmarkdownon Mar 14 2025.

Last update: 2024-10-11
Started: 2019-07-22

Spatial data

Rendered fromspatial.Rmdusingknitr::rmarkdownon Mar 14 2025.

Last update: 2024-10-11
Started: 2020-08-07

Citation

To cite ruODK in publications use (with the correct version number:

Mayer, Florian Wendelin. (2020, Nov 19). ruODK: An R Client for the ODK Central API (Version X.X.X). Zenodo. https://doi.org/10.5281/zenodo.5559164

Corresponding BibTeX entry:

  @Misc{,
    title = {ruODK: Client for the ODK Central API},
    author = {Florian W. Mayer},
    note = {R package version X.X.X},
    year = {2020},
    url = {https://github.com/ropensci/ruODK},
  }

Readme and manuals

ruODK: An R Client for the ODK Central API ruODKEspecially in these trying times, it is important to ask: ruODK?

Especially in these trying times, it is important to ask “r u ODK?”.

ruODK is an R client to access and parse data from ODK Central.

OpenDataKit (ODK) is free-and open-source software that helps millions of people collect data quickly, accurately, offline, and at scale. The software is in active use in every country in the world and is supported by a large and helpful community.

ruODK is a community contribution to the ODK ecosystem, but not directly affiliated with ODK.

ruODK assumes some familiarity of its users with the ODK ecosystem and workflows. For a detailed overview, read the extensive ODK documentation and visit the friendly ODK forum.

ODK Central is a cloud-based data clearinghouse for digitally captured data, replacing the older software ODK Aggregate. ODK Central manages user accounts and permissions, stores form definitions, and allows data collection clients like ODK Collect to connect to it for form download and submission upload.

An ODK setup with ODK Build, Central, Collect, and ruODK

A typical ODK workflow: An XForm is designed e.g. in ODK Build, published to ODK Central, and downloaded onto an Android device running ODK Collect. After data have been captured digitally using ODK Collect, the data are uploaded and stored in ODK Central. The next step from there is to extract the data, optionally upload it into another data warehouse, and then to analyse and generate insight from it.

While data can be retrieved in bulk through the GUI, ODK Central’s API provides access to its data and functionality through both an OData and a RESTful API with a comprehensive and interactive documentation.

ruODK is aimed at the technically minded researcher who wishes to access and process data from ODK Central using the programming language R.

Benefits of using the R ecosystem in combination with ODK:

  • Scalability: Both R and ODK are free and open source software. Scaling to many users does not incur license fees.
  • Ubiquity: R is known to many scientists and is widely taught at universities.
  • Automation: The entire data access and analysis workflow can be automated through R scripts.
  • Reproducible reporting (e.g. Sweave, RMarkdown), interactive web apps (Shiny), workflow scaling (drake).
  • Rstudio-as-a-Service (RaaS) at Hosted RStudio with ruODK

ruODK’s scope:

  • To wrap all ODK Central API endpoints with a focus on data access.
  • To provide working examples of interacting with the ODK Central API.
  • To provide convenience helpers for the day to day tasks when working with ODK Central data in R: data munging the ODK Central API output into tidy R formats.

ruODK’s use cases:

  • Smaller projects: Example rOzCBI
    1. Data collection: ODK Collect
    2. Data clearinghouse: ODK Central
    3. Data analysis and reporting: Rmd (ruODK)
    4. Publishing and dissemination: ckanr, CKAN
  • Larger projects:
    1. Data collection: ODK Collect
    2. Data clearinghouse: ODK Central
    3. ETL pipeline into data warehouses: Rmd (ruODK)
    4. QA: in data warehouse
    5. Reporting: Rmd
    6. Publishing and dissemination: ckanr, CKAN

Out of scope:

  • To wrap “management” API endpoints. ODK Central is a VueJS/NodeJS application which provides a comprehensive graphical user interface for the management of users, roles, permissions, projects, and forms.
  • To provide extensive data visualisation. We show only minimal examples of data visualisation and presentation, mainly to illustrate the example data. Once the data is in your hands as tidy tibbles… urODK!

A quick preview

ruODK screencast

Install

You can install the latest release of ruODK from the rOpenSci R-Universe:

# Enable the rOpenSci universe
options(repos = c(
  ropensci = "https://ropensci.r-universe.dev",
  CRAN = "https://cloud.r-project.org"
))
install.packages("ruODK")

Alternatively, you can install the development version from the main branch.

if (!requireNamespace("remotes")) install.packages("remotes")
# Full install
remotes::install_github(
  "ropensci/ruODK@main",
  dependencies = TRUE,
  upgrade = "always",
  build_vignettes = TRUE
)

# Minimal install without vignettes
remotes::install_github(
  "ropensci/ruODK@main",
  dependencies = TRUE,
  upgrade = "ask",
  build_vignettes = FALSE
)

If the install fails, read the error messages carefully and install any unmet dependencies (system libraries or R packages).

If the install fails on building the vignettes, you can set build_vignettes=FALSE and read the vignettes from the online docs instead.

If the installation still fails, or the above does not make any sense, feel free to submit a bug report.

Try ruODK ruODK

You can also run ruODK through hosted or self-built Docker images.

In decreasing order of simplicity:

  • Launch a hosted RStudio Server Hosted RStudio with ruODK

  • Launch a hosted JupyterLab server (with all kernel options available) Hosted JupyterLab with ruODK

  • Download the pre-built ruODK Docker image based on the last tagged ruODK version

    docker pull ghcr.io/ropensci/ruodk:latest
    docker run ghcr.io/ropensci/ruodk:latest
    
  • Build the latest ruODK version locally with your own GitHub Personal Access Token (PAT)

    git clone git@github.com:ropensci/ruODK.git
    cd ruODK
    docker build . -t <myorg>/ruodk:latest --build-arg GITHUB_PAT="..."
    docker run -p 8888:8888 <myorg>/ruodk:latest
    

The running Docker image will print a URL you can click on. The URL will open JupyterLab in your browser. From there, you can run any available kernel, amongst others are RStudio and a plain R shell.

Configure ruODK ruODK

For all available detailed options to configure authentication for ruODK, read vignette("setup", package = "ruODK").

Use ruODK ruODK

A detailed walk-through with some data visualisation examples is available in the vignette("odata-api", package="ruODK").

See also vignette("restful-api", package="ruODK") for examples using the alternative RESTful API.

urODK, a sing-along ruODK workshop about you, R, and ODK, is available on Hosted RStudio with ruODK.

Contribute

Contributions through issues and PRs are welcome!

See the contributing guide on best practices and further readings for code contributions.

Attribution

ruODK was developed by Florian Mayer for the Western Australian Department of Biodiversity, Conservation and Attractions (DBCA). The development was funded both by DBCA core funding and external funds from the North West Shelf Flatback Turtle Conservation Program.

ruODK is maintained and extended by Florian Mayer.

To cite package ruODK in publications use:

citation("ruODK")
#> To cite ruODK in publications use (with the correct version number:
#>
#>   Mayer, Florian Wendelin. (2020, Nov 19).  ruODK: An R Client for the ODK Central API (Version X.X.X).  Zenodo.
#>   https://doi.org/10.5281/zenodo.5559164
#>
#> A BibTeX entry for LaTeX users is
#>
#>   @Misc{,
#>     title = {ruODK: Client for the ODK Central API},
#>     author = {Florian W. Mayer},
#>     note = {R package version X.X.X},
#>     year = {2020},
#>     url = {https://github.com/ropensci/ruODK},
#>   }

Acknowledgements

The Department of Biodiversity, Conservation and Attractions (DBCA) acknowledges the traditional owners of country throughout Western Australia and their continuing connection to the land, waters and community. We pay our respects to them, their culture and to their Elders past and present.

This software was created on Whadjuk boodja (ground) both as a contribution to the ODK ecosystem and for the conservation of the biodiversity of Western Australia, and in doing so, caring for country.

Package functionality

See vignette("comparison", package="ruODK") for a comprehensive comparison of ruODK to other software packages from both an ODK and an OData angle.

Help Manual

Help pageTopics
Download attachments and return the local path.attachment_get
Prefix attachment columns from CSV export with a local attachment file path.attachment_link
List all attachments for a list of submission instances.attachment_list
Get server audit log entries.audit_get
Drop any NULL coordinates from a GeoJSON geometry.drop_null_coords
List all encryption keys for a form.encryption_key_list
Return server audit logs of one Entity.entity_audits
List changes to one Entity.entity_changes
Creates exactly one Entity in the Dataset.entity_create
Delete one Entity.entity_delete
Show metadata and current data of one Entity.entity_detail
List all Entities of a kind.entity_list
Update one Entity.entity_update
List versions of one Entity.entity_versions
Show Entity List details.entitylist_detail
Download an Entity List as CSV.entitylist_download
List all Entity Lists of one Project.entitylist_list
Update Entity List details.entitylist_update
Show details for one form.form_detail
List all forms.form_list
Show the schema of one form.form_schema
Show the extended schema of one form.form_schema_ext
Parse a form_schema into a tibble of fields with name, type, and path.form_schema_parse
Show the XML representation of one form as list.form_xml
A tibble of submission attachments.fq_attachments
Parsed submission data for an ODK Central form.fq_data
Parsed submission data for a subgroup of an ODK Central form.fq_data_strata
Parsed submission data for a subgroup of an ODK Central form.fq_data_taxa
A tibble of form metadata.fq_form_detail
A tibble of forms.fq_form_list
JSON form schema for an ODK Central form.fq_form_schema
A nested list of a form definition.fq_form_xml
OData metadata document for an ODK Central form.fq_meta
A tibble of project metadata.fq_project_detail
A tibble of project metadata.fq_project_list
OData submission data for an ODK Central form.fq_raw
OData submission data for a subgroup of an ODK Central form.fq_raw_strata
OData submission data for a subgroup of an ODK Central form.fq_raw_taxa
A tibble of submission metadata.fq_submission_list
A nested list of submission data.fq_submissions
OData service document for an ODK Central form.fq_svc
A tibble of the main data table of records from a test form.fq_zip_data
A tibble of a repeated sub-group of records from a test form.fq_zip_strata
A tibble of a repeated sub-group of records from a test form.fq_zip_taxa
The parsed XML form_schema of a form from ODK Central v0.6.fs_v7
The unparsed XML form_schema of a form from ODK Central v0.6 as nested list.fs_v7_raw
The form_schema of a form containing geofields in GeoJSON.geo_fs
The parsed submissions of a form containing geofields in GeoJSON.geo_gj
The unparsed submissions of a form containing geofields in GeoJSON.geo_gj_raw
The parsed submissions of a form containing geofields in GeoJSON with trailing empty coordinates present.geo_gj88
The parsed submissions of a form containing geofields in WKT.geo_wkt
The unparsed submissions of a form containing geofields in WKT.geo_wkt_raw
The parsed submissions of a form containing geofields in WKT with trailing empty coordinates present.geo_wkt88
Download one media attachment.get_one_attachment
Download one submission.get_one_submission
List all attachments of one submission.get_one_submission_att_list
Download server audit logs for one submission.get_one_submission_audit
Download and link submission attachments according to a form schema.handle_ru_attachments
Parse datetimes of submission data according to a form schema.handle_ru_datetimes
Split all geopoints of a submission tibble into their components.handle_ru_geopoints
Split all geoshapes of a submission tibble into their components.handle_ru_geoshapes
Split all geotraces of a submission tibble into their components.handle_ru_geotraces
Get the Data Document from the OData Dataset Service.odata_entitylist_data_get
Get the Metadata Document from the OData Dataset Service.odata_entitylist_metadata_get
Get the Service Document from the OData Dataset Service.odata_entitylist_service_get
Retrieve metadata from an OData URL ending in .svc as list of lists.odata_metadata_get
Retrieve service metadata from an OData URL ending in .svc as tibble.odata_service_get
Retrieve and rectangle form submissions, parse dates, geopoints, download and link attachments.odata_submission_get
Rectangle the output of 'odata_submission_get(parse=FALSE)' into a tidy tibble and unnest all levels.odata_submission_rectangle
Retrieve URL, project ID, and form ID from an ODK Central OData service URL.odata_svc_parse
Parse a given ODK Central version string or number into a 'semver'.parse_odkc_version
Create a new project.project_create
List all details of one project.project_detail
List all projects.project_list
rlang::abort() with a red error message with a cross symbol.ru_msg_abort
Print a blue info message with an info symbol.ru_msg_info
Print a green noop message with a filled circle symbol.ru_msg_noop
Print a green success message with a tick symbol.ru_msg_success
rlang::warn() with a yellow warning message with a warning symbol.ru_msg_warn
Get or set 'ruODK' settings.get_default_fid get_default_odkc_version get_default_orders get_default_pid get_default_pp get_default_pw get_default_tz get_default_un get_default_url get_retries get_ru_verbose get_test_fid get_test_fid_att get_test_fid_gap get_test_fid_wkt get_test_fid_zip get_test_odkc_version get_test_pid get_test_pp get_test_pw get_test_un get_test_url ru_settings
Configure default 'ruODK' settings.ru_setup
Show whether a given semver is greater than a baseline version.semver_gt
Show whether a given semver is lesser than a baseline version.semver_lt
Annotate a dataframe containing a geopoint column with lon, lat, alt.split_geopoint
Annotate a dataframe containing a geoshape column with lon, lat, alt of the geotrace's first point.split_geoshape
Annotate a dataframe containing a geotrace column with lon, lat, alt of the geotrace's first point.split_geotrace
Get submission audits for a list of submission instance IDs.submission_audit_get
Show metadata for one submission.submission_detail
Export all form submissions including repeats and attachments to CSV.submission_export
Get submissions for a list of submission instance IDs.submission_get
List all submissions of one form.submission_list
List all users.user_list