question_type: question_type

Description Usage Arguments Value See Also Examples

Description

Determines the kobo question type for a given variable name

Usage

1
2
question_type(variable.name, data = NULL, from.questionnaire = T,
  from.data = T)

Arguments

variable.name

the kobo question name for which the type should be determined. (works on a vector with multiple names)

data

the dataset matching the kobo questionnaire. This can be left empty if from.data=F. A provided dataset can be used as a fallback with from.data=T in case the data type can not be determined from the questionnaire.

from.questionnaire

if FALSE, prevent determinining data type from questionnaire. Can not be FALSE if from.data is also FALSE.

from.data

if TRUE, allows to determine data type from provided data. Can not be FALSE if from.data is also FALSE. If both from.questionnaire and from.data are TRUE, data types determined from the questionnaire have precedence.

Value

a string naming the question type. One of "select_one", "select_multiple" or "numeric".

See Also

Should be used after load_questionnaire, but can work without if data is provided as a fallback.

Examples

1
question_type("question_name_in_loaded_questionnaire")

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