Learn R Programming

rcoder (version 0.3.0)

odk_to_coding: Convert ODK choices to a coding

Description

ODK XLSForms link the categorical codings to a variable type name in the 'survey' sheet. The codings are specified in the 'choices' sheet which has a `list_name` column that holds the variable type names. Each row that has that name will be associated with that categorical type coding. This function converts subsets of the choices sheet into individual 'coding' objects.

Usage

odk_to_coding(choice_table)

Value

A `coding` object that corresponds to the choices' slice

Arguments

choice_table

A data.frame slice of the "choices" table from an XLSForm

See Also

[coding_to_odk()]

Examples

Run this code
choice_excerpt <- data.frame(
  list_name = rep("yesno", 2),
  name = c("Yes", "No"),
  label = c(1, 0)
)

odk_to_coding(choice_excerpt)

Run the code above in your browser using DataLab