Skip to contents

Get all submissions from a KoboToolbox API asset through a kobo_asset or asset unique identifier.

Usage

kobo_data(
  x,
  lang,
  all_versions,
  colnames_label,
  select_multiple_label,
  progress,
  paginate,
  page_size
)

kobo_submissions(
  x,
  lang,
  all_versions,
  colnames_label,
  select_multiple_label,
  progress,
  paginate,
  page_size
)

# S3 method for kobo_asset
kobo_submissions(
  x,
  lang = NULL,
  all_versions = TRUE,
  colnames_label = FALSE,
  select_multiple_label = FALSE,
  progress = FALSE,
  paginate = NULL,
  page_size = NULL
)

# S3 method for character
kobo_submissions(
  x,
  lang = NULL,
  all_versions = TRUE,
  colnames_label = FALSE,
  select_multiple_label = FALSE,
  progress = FALSE,
  paginate = NULL,
  page_size = NULL
)

# S3 method for default
kobo_submissions(
  x,
  lang = NULL,
  all_versions = TRUE,
  colnames_label = FALSE,
  select_multiple_label = FALSE,
  progress = FALSE,
  paginate = NULL,
  page_size = NULL
)

Arguments

x

the asset uid or the kobo_asset object.

lang

character, form language used for the variable and value labels.

all_versions

logical, whether or not to include submissions from all form versions. Default to TRUE. If FALSE, it uses the data from the latest version of the form.

colnames_label

logical, whether or not to use variable labels in lieu of column names based on form question names. Default to FALSE.

select_multiple_label

logical, whether or not to replace select_multiple columns values by labels. Default to FALSE.

progress

logical, whether or not you want to see the progess via message. Default to FALSE.

paginate

logical, split submissions by page_size. Default to NULL.

page_size

integer, number of submissions per page.

Value

A data.frame or A dm object if you have a repeating group of questions. It contains the responses from the Kobotoolbox survey.

Details

kobo_data is the main function of robotoolbox, it is used pull submissions from your Kobotoolbox survey. The main result is a data.frame for regular form and you have a dm for a form with repeating groups of questions.

Examples

if (FALSE) {
# Use your own URL and token
kobo_setup(url = "https://kf.kobotoolbox.org/",
           token = "9et1814c285w094f6v9bd629df47a1a0e81x53a0")
# Use your own unique identifier
uid <- "a9cwEQcbWqWzA5hzkjRUWi"
asset <- kobo_asset(uid)
subs <- kobo_data(asset)

if (require(dplyr)) {
 library(dplyr)
 glimpse(subs)
 }
}