Generate a consolidated xlsform from a list of xlsform in order to quickly flag differences
Source:R/fct_xlsform_compare.R
fct_xlsform_compare.Rd
Note that comparison is done for a selected language
Arguments
- listfile
list of full path to multiple xlsform files - ll assumed to be in the same folder. The first one will be used as the master to compare the other to
- label_language
Language to be used in case you have more than one. If not specified, the 'default_language' in the 'settings' worksheet is used. If that is not specified and more than one language is in the XlsForm, the language that comes first within column order will be used.
- fileout
if specified defined the full path name of the file to save the xlsform _compare output
Examples
## With 2 files
check <- fct_xlsform_compare(
listfile = c( system.file("demo.xlsx", package = "XlsFormUtil"),
system.file("demo_adapt1.xlsx", package = "XlsFormUtil") ),
label_language = NULL,
fileout = NULL)
#> demo_adapt1
#>
# variablescompare,
knitr::kable(utils::head(as.data.frame(check[1]), 10))
#>
#>
#> |name |type |type.ifdiff.demo_adapt1 |list_name |list_name.ifdiff.demo_adapt1 |label |label.ifdiff.demo_adapt1 |hint |hint.ifdiff.demo_adapt1 |required |required.ifdiff.demo_adapt1 |relevant |constraint.ifdiff.demo_adapt1 |constraint |relevant.ifdiff.demo_adapt1 |
#> |:----------------|:-----------|:-----------------------|:-----------|:----------------------------|:--------------------------------------------|:------------------------|:-----------------------|:-----------------------|:--------|:---------------------------|:---------------------------------------------------|:-----------------------------|:----------|:---------------------------|
#> |start |start |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |
#> |end |end |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |
#> |simserial |simserial |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |
#> |deviceid |deviceid |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |
#> |phonenumber |phonenumber |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |NA |
#> |your_name |text |NA |NA |NA |001b. Enter your name below. bla bla bla bla |NA |Please record your name |NA |true |NA |NA |NA |NA |NA |
#> |school_level_001 |select_one |NA |school_list |NA |Whoa - does this question sync? 2 |NA |NA |NA |true |NA |(${begin_interview}='yes') and (${available}='yes') |NA |NA |NA |
#> |name_typed |text |NA |NA |NA |001b. Enter your name below. |NA |Please record your name |NA |true |NA |NA |NA |NA |NA |
#> |today |calculate |NA |NA |NA |NA |NA |NA |NA |false |NA |NA |NA |NA |NA |
#> |this_country |calculate |NA |NA |NA |NA |NA |NA |NA |false |NA |NA |NA |NA |NA |
# choicescompare
knitr::kable(utils::head(as.data.frame(check[2]), 10, 10))
#>
#>
#> |name |list_name |label |label.ifdiff.demo_adapt1 |
#> |:---------|:-----------|:--------------|:------------------------|
#> |never |school_list |Never attended |NA |
#> |never |school_list |Never attended |Never Attended |
#> |primary |school_list |Primary |NA |
#> |primary |school_list |Primary |Primary (1-8) |
#> |secondary |school_list |Secondary |NA |
#> |secondary |school_list |Secondary |Secondary (9-12) |
#> |tertiary |school_list |Tertiary |NA |
#> |-99 |school_list |No response |NA |
#> |-99 |school_list |No response |NA |
#> |never |school_list |Never Attended |Never attended |
## With 3 files
check <- fct_xlsform_compare(
listfile = c( system.file("demo.xlsx", package = "XlsFormUtil"),
system.file("demo_adapt1.xlsx", package = "XlsFormUtil"),
system.file("demo_adapt2.xlsx", package = "XlsFormUtil") ),
label_language = NULL,
fileout = NULL)
#> demo_adapt1
#>
#> demo_adapt2
#>