Prepare XLSform by adding instructions for the analysis plan and checking that structure and settings are correct. This function open the xlsform - extend if required including the excel formatting, display the analysis plan summary and resave the file at the end.
Once those elements are set up, they will be automatically considered during the automatic crunching phase. An additional worksheet is also created to document the information required for registration on UNHCR CKAN instance http://ridl.unhcr.org
Configuration of how questions are grouped together in the report:
chapter: by default the crunching report is presented according to the group. Once set, this will replace the original grouping. Only variable defined within a chapter will be displayed in the crunching report. By default chapter will follow the questions sequence - if chapters start with a number that number will overrule the sequence
subchapter: provides a second level of details below the chapter if sub-chapters start with a number that number will overrule the sequence
Configuration for data manipulation:
clean: define what variable shall be re-categorized during cleaning - a local copy of all levels will be locally saved in order to do the mapping in excel. When the mapping is available, it will be automatically applied to the data. Can be useful to reduce the number of categories.
anonymise: define what variables to consider to statistical disclosure risk measurement and subsequent data treatment
Configuration of specific charts, visualization and analysis:
disaggregation: define variable to use for visual cross tabulation - functions with "_cross"
correlate: define the variable to use to explore statistical association - works under certain restrictions (i.e. between 2 categorical variables only): kobo_correlate
cluster: define variable to generate an unsupervised classification (i.e. hierarchical clustering based on multiple correspondance analysis) kobo_cluster
predict: define variable to use to generate predictive model, ie.e the target variable and the predictors. kobo_predict
score: define the different dimensions of a score - and used the score set up for the choice test different aggregation approaches
mappoint, mappoly: define the variable to use to generate maps - kobo_map
In case if those fields do not yet exist, the function will create dummy column for each one. Also, coloring all rows that have type equal to "begin group", "end group", "begin repeat" or "end repeat" for better legibility
Arguments
- xlsformpath
The full path and filename of the xlsform to be accessed (has to be xlsx file)
- xlsformpathout
The full path and filename of the xlsform to be accessed (has to be xlsx file)
- label_language
Optional if the form used multiple languages, indicate the language to use to prepare the analysis plan - check first in your original file. This is strictly based on what is inside your form for instance
english (en)
,Español (es)
, orspanish (es)
. Noe that language encoding description should follow https://xlsform.org/en/#multiple-language-supportDo not includ the
::
that comes after the label and that separates it from the language suffix- ridl
If available, it will pre-fill the RIDL info through what was already recorded there
Examples
kobo_prepare_form(xlsformpath = system.file("form.xlsx", package = "kobocruncher"),
xlsformpathout = NULL,
label_language = "")
#> [1] "There was an error in the xlsform preparation step!!! \n\n"
#> $message
#> [1] "`path` does not exist: ‘’"
#>
#> $call
#> NULL
#>
#> attr(,"class")
#> [1] "try-error"