Skip to contents

Pulls OData submissions from an ODK server using the ruODK package and stores the downloaded files in a temporary (or user‑specified) folder.

Usage

get_odk_data(
  wkt = TRUE,
  display_form_structure = FALSE,
  download = FALSE,
  path_attachment = tempdir(),
  verbose = FALSE
)

Arguments

wkt

Logical. Should geospatial data be returned as Well-known-text (TRUE) or as GeoJSON (FALSE)? Default to TRUE

display_form_structure

Logical. Default to FALSE. See details

download

Logical. Whether to download the attachment files.

path_attachment

Character. Directory where the downloaded attachment files are written. Defaults to tempdir().

verbose

Logical. Whether to display debug messages or not.

Value

A data‑frame containing the OData submissions received from the server. The function also prints a message with the the number of individuals/observations in the database. If display_form_structure = TRUE an HTML page with an interactive visualization of the form structure.

Details

when display_form_structure = TRUE, the ODK form structure is retrieved and displayed using the listviewer package, allowing for interactive viewing and editing in JSON format.`

See also

Examples

## -----------------------------------------------------------------
## The following examples illustrate typical usage.  They are wrapped in
## \dontrun{} to avoid contacting a live server.
## -----------------------------------------------------------------
if (FALSE) { # \dontrun{
# Download all submissions to a temporary folder
df_all <- get_odk_data()

# Show the form structure (will be displayed after the return statement
# if the function is modified accordingly)
get_odk_data(display_form_structure = TRUE)
} # }