load_questionnaire: load_questionnaire

Description Usage Arguments Value Examples

View source: R/loading.R

Description

load_questionnaire

Usage

1
2
load_questionnaire(data, questions, choices,
  choices.label.column.to.use = NULL)

Arguments

data

data frame containing the data matching the questionnaire to be loaded.

questions

data frame or file name of a csv file containing the kobo form's question sheet

choices

data frame or file name of a csv file containing the kobo form's choices sheet

choices.label.column.to.use

The choices csv file has (sometimes multiple) columns with labels. They are often called "Label::English" or similar. Here you need to provide the _name of the column_ that you want to use for labels (see example!)

Value

A list containing the original questionnaire questions and choices, the choices matched 1:1 with the data columns, and all functions created by this function relating to the specific questionnaire (they are written to the global space too, but you can use these when using multiple questionnaires in parallel.)

Examples

1
2
3
4
5
6
7
## Not run: 
load_questionnaire(mydata,
                  questions.file="koboquestions.csv",
                  choices.file="kobochoices.csv",
                  choices.label.column.to.use="Label::English")

## End(Not run)

mabafaba/hypegrammaR documentation built on Oct. 2, 2019, 11:33 a.m.