question_is_categorical: Determine if a kobo question is categorical

Description Usage Arguments Details Value See Also Examples

View source: R/closure_defaults.R

Description

Uses a loaded kobo questionnaire to look up the question type for a given question; returns true for select_one or select_multiple

Usage

1
question_is_categorical(question.name)

Arguments

question.name

The xml name of a kobo question as a string. (as it appears in the kobo questionnaire and subsequently in the data column headers)

Details

To use this you must first successfully run load_questionnaire. This does not derive the data type from any actual data; it only looks up the type defined in the questionnaire. If type identification fails, the default return value is FALSE.This happens in the following cases:

Value

TRUE if the question is listed as a select_one or select_multiple type in the questionnaire. FALSE if the question is listed as a different type. FALSE if the question type could not be determined from the questionnaire.

See Also

load_questionnaire must be run first. Use question_type for the most generalised way to guess the data type. Part of the question_is_* family of functions: testing for specific types: question_is_numeric, question_is_categorical, question_is_select_one, question_is_select_multiple, question_is_sm_choice

parsing kobo skip-logic: question_is_skipped

Examples

1
2
3
4
question_is_categorical("some_numeric_kobo_xml_question_name") # FALSE
question_is_categorical("a_select_one_kobo_xml_question_name") # TRUE
question_is_categorical("a_select_multiple_kobo_xml_question_name") # TRUE
question_is_categorical("some_unidentified_string") # FALSE

mabafaba/koboquest documentation built on Aug. 15, 2019, 6:12 p.m.