diff --git a/README.md b/README.md index 3734547..f770c22 100644 --- a/README.md +++ b/README.md @@ -6,69 +6,37 @@ [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +`{surveyDesigner}` is a shinyApp to parse a master referential of questions and indicators to generate a contextualized series of [xlsform](http://xlsform.org) questionnaires. -`{surveyDesigner}` is a shinyApp to parse a master XlsForm to generate a contextualized questionnaire. -The app is build using [`{golem}` framework](https://thinkr-open.github.io/golem) and following the tutorial: [Engineering Production-Grade Shiny Apps](https://engineering-shiny.org//). +For the end-user, aka the Survey Coordinator at Operation level, the application is expected to: -Read more on the rationale for this app in the [vignette](https://unhcr-americas.github.io/surveyDesigner/docs/articles/surveyDesigner.html) + 1. Enforce a questionnaire design process that __starts from a selection of indicators__ that needs to be measured and pre-select automatically all the required standardized survey modules and questions in order to measure them. Not only this ensure that standards are actually used, but it will also minimize the risk of questionnaire design mistakes: "_collect what you need, use what you collect_" + + 2. Ease the __contextualization process__ from the global referential to the actual implementation in each country (i.e translating and adjusting the labels as per the specific context) and facilitate the feedback loop so that if the same ad-hoc questions are used in multiple context, they can be considered for inclusion in the global referential + + 3. Support the usage of [mixed-mode (CAPI/CATI?CAWI)](https://www.youtube.com/watch?v=qRmy2OAnyWc) and multiple data collection waves to collect the final dataset within an __annual survey data collection cycle__, all of this allowing both to promote survey integration and to maximize the financial resources invested in those activities -## Installation +Overall, this will contribute over time to the creation of [standardized survey-based indicators](https://egrisstats.org/resource/data-disaggregation-of-sdg-indicators-by-forced-displacement/) for comparative data analysis across countries and contexts. -You can install the development version from [GitHub](https://github.com/Thinkr-open/golem) with: +Read more on the rationale for this app in the [vignette](https://unhcr-americas.github.io/surveyDesigner/docs/articles/surveyDesigner.html) or go through the [wiki](https://github.com/unhcr-americas/surveyDesigner/wiki) to go through the technical specifications -``` r -# install.packages("remotes") -remotes::install_github("unhcr-americas/surveyDesigner") -``` ## Run the app -This script allows you to display the app -``` r -# Run the application -surveyDesigner::run_app() -``` +The app is still under development - the prototype is accessible here: https://rstudio.unhcr.org/Survey_Designer/ -## Update the app -This script allows you to quickly rebuild and display the app +To run it locally, use ``` r -# Detach all loaded packages and clean your environment -golem::detach_all_attached() - -# rm(list=ls(all.names = TRUE)) - -# Document and reload your package -golem::document_and_reload() - +# install.packages("remotes") +remotes::install_github("unhcr-americas/surveyDesigner") # Run the application surveyDesigner::run_app() ``` +## For developpers - -## Update the package documentation - -This script allows to update the package documentation - -``` r -devtools::document() - -devtools::check(document = FALSE) - -pkgdown::build_site() -``` - -## As dev : - -Please use template commit and MR : - -``` r -project_path <- "path_to_surveyDesigner" -gert::git_config_set(repo = project_path, name = "commit.template", value = ".github/template_commit") -``` - -## Code of Conduct +The app is build using [`{golem}` framework](https://thinkr-open.github.io/golem) and following the tutorial: [Engineering Production-Grade Shiny Apps](https://engineering-shiny.org//). Please note that the surveyDesigner project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. diff --git a/docs/404.html b/docs/404.html index 5826594..b8e9bba 100644 --- a/docs/404.html +++ b/docs/404.html @@ -52,7 +52,7 @@
diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 0bc2f20..5e3bbad 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -35,7 +35,7 @@class-r6-for-the-referential.Rmd
+library(surveyDesigner)
The filtering of the referential should take in account the +order/sequence of questions and modules.
+A specific method is implemented to separate our file with begin and +end group
+
+ref <- Referential$new(
+ path = system.file("SurveyDesigner_Referential.xlsx", package = "surveyDesigner")
+)
+#> New names:
+#> result is store in `by_groups` sub-element
+#> • `` -> `...14`
+
+head(ref$data$survey)
+#> # A tibble: 6 × 33
+#> referential_id type name label hint required required_message constraint
+#> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr>
+#> 1 household_survey start start NA NA NA NA NA
+#> 2 household_survey end end NA NA NA NA NA
+#> 3 household_survey calcu… star… NA NA NA NA NA
+#> 4 household_survey calcu… end_t NA NA NA NA NA
+#> 5 household_survey calcu… time… Time… NA NA NA NA
+#> 6 household_survey calcu… time… Time… NA NA NA NA
+#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
+#> # appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
+#> # repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
+#> # `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
+#> # contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
+#> # sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
+#> # subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
+
+# Example by groups
+ref$by_groups$group_intro
+#> $data
+#> # A tibble: 6 × 33
+#> referential_id type name label hint required required_message constraint
+#> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr>
+#> 1 household_survey date inte… Plea… NA false NA NA
+#> 2 household_survey selec… Bure… Plea… Read… true NA NA
+#> 3 household_survey selec… Coun… Plea… Read… true NA NA
+#> 4 household_survey calcu… coun… NA NA false NA NA
+#> 5 household_survey geopo… geop… Reco… NA false NA NA
+#> 6 household_survey selec… pop_… Plea… Read… true NA NA
+#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
+#> # appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
+#> # repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
+#> # `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
+#> # contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
+#> # sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
+#> # subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
+#>
+#> $information
+#> # A tibble: 2 × 33
+#> referential_id type name label hint required required_message constraint
+#> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr>
+#> 1 household_survey begin… grou… Inte… NA false NA NA
+#> 2 household_survey end_g… NA NA NA NA NA NA
+#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
+#> # appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
+#> # repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
+#> # `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
+#> # contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
+#> # sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
+#> # subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
{surveyDesigner}
is a shinyApp to parse a master XlsForm to generate a contextualized questionnaire.
The app is build using {golem}
framework and following the tutorial: Engineering Production-Grade Shiny Apps.
Read more on the rationale for this app in the vignette
+{surveyDesigner}
is a shinyApp to parse a master referential of questions and indicators to generate a contextualized series of xlsform questionnaires.
For the end-user, aka the Survey Coordinator at Operation level, the application is expected to:
+Enforce a questionnaire design process that starts from a selection of indicators that needs to be measured and pre-select automatically all the required standardized survey modules and questions in order to measure them. Not only this ensure that standards are actually used, but it will also minimize the risk of questionnaire design mistakes: “collect what you need, use what you collect”
Ease the contextualization process from the global referential to the actual implementation in each country (i.e translating and adjusting the labels as per the specific context) and facilitate the feedback loop so that if the same ad-hoc questions are used in multiple context, they can be considered for inclusion in the global referential
Support the usage of mixed-mode (CAPI/CATI?CAWI) and multiple data collection waves to collect the final dataset within an annual survey data collection cycle, all of this allowing both to promote survey integration and to maximize the financial resources invested in those activities
Overall, this will contribute over time to the creation of standardized survey-based indicators for comparative data analysis across countries and contexts.
+Read more on the rationale for this app in the vignette or go through the wiki to go through the technical specifications
You can install the development version from GitHub with:
+The app is still under development - the prototype is accessible here: https://rstudio.unhcr.org/Survey_Designer/
+To run it locally, use
# install.packages("remotes")
-remotes::install_github("unhcr-americas/surveyDesigner")
This script allows you to display the app
-
-# Run the application
-surveyDesigner::run_app()
This script allows you to quickly rebuild and display the app
-
-# Detach all loaded packages and clean your environment
-golem::detach_all_attached()
-
-# rm(list=ls(all.names = TRUE))
-
-# Document and reload your package
-golem::document_and_reload()
-
+remotes::install_github("unhcr-americas/surveyDesigner")
# Run the application
surveyDesigner::run_app()
This script allows to update the package documentation
-
-devtools::document()
-
-devtools::check(document = FALSE)
-
-pkgdown::build_site()
Please use template commit and MR :
-
-project_path <- "path_to_surveyDesigner"
-gert::git_config_set(repo = project_path, name = "commit.template", value = ".github/template_commit")
The app is build using {golem}
framework and following the tutorial: Engineering Production-Grade Shiny Apps.
Please note that the surveyDesigner project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
data
named list for the xlsx file
named list for the referential file
by_groups
survey data separate by begin and end to manipulate data
survey modules separated by begin and end to manipulate data
path
path
path to the xlsForm
path to the file with the full referential
ref <- Referential$new(
- path = system.file("household_survey_americas.xlsx", package = "surveyDesigner")
+ path = system.file("SurveyDesigner_Referential.xlsx", package = "surveyDesigner")
)
head(ref$data$survey)
@@ -155,55 +155,63 @@ Examples
## ------------------------------------------------
ref <- Referential$new(
- path = system.file("household_survey_americas.xlsx", package = "surveyDesigner")
+ path = system.file("SurveyDesigner_Referential.xlsx", package = "surveyDesigner")
)
+#> New names:
+#> • `` -> `...14`
#> result is store in `by_groups` sub-element
head(ref$data$survey)
-#> # A tibble: 6 × 19
-#> type name `label::English (en)` `label::Spanish (es)` `label::French (fr)`
-#> <chr> <chr> <chr> <chr> <chr>
-#> 1 start start NA NA NA
-#> 2 end end NA NA NA
-#> 3 calcul… star… NA NA NA
-#> 4 calcul… end_t NA NA NA
-#> 5 calcul… time… Time difference in s… NA NA
-#> 6 calcul… time… Time difference in m… NA NA
-#> # ℹ 14 more variables: `label::Arabic (ar)` <chr>, `hint::English (en)` <chr>,
-#> # `hint::Spanish (es)` <chr>, `hint::French (fr)` <chr>,
-#> # `hint::Arabic (ar)` <chr>, required <chr>, appearance <chr>,
-#> # choice_filter <chr>, calculation <chr>, relevant <chr>, constraint <chr>,
-#> # constraint_message <chr>, repeat_count <chr>, `$given_name` <chr>
+#> # A tibble: 6 × 33
+#> referential_id type name label hint required required_message constraint
+#> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr>
+#> 1 household_survey start start NA NA NA NA NA
+#> 2 household_survey end end NA NA NA NA NA
+#> 3 household_survey calcu… star… NA NA NA NA NA
+#> 4 household_survey calcu… end_t NA NA NA NA NA
+#> 5 household_survey calcu… time… Time… NA NA NA NA
+#> 6 household_survey calcu… time… Time… NA NA NA NA
+#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
+#> # appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
+#> # repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
+#> # `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
+#> # contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
+#> # sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
+#> # subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
# Example by groups
ref$by_groups$group_intro
#> $data
-#> # A tibble: 6 × 19
-#> type name `label::English (en)` `label::Spanish (es)` `label::French (fr)`
-#> <chr> <chr> <chr> <chr> <chr>
-#> 1 date inte… Please enter the dat… Por favor, introduzc… Sélectionnez la dat…
-#> 2 select… Bure… Please select the Re… Seleccione la Oficin… Sélectionnez le bur…
-#> 3 select… Coun… Please select the co… Seleccione el país e… Sélectionnez le pay…
-#> 4 calcul… coun… NA NA NA
-#> 5 geopoi… geop… Record your current … Registre su ubicació… Enregistrez votre p…
-#> 6 select… pop_… Please select which … Seleccione el grupo … Sélectionnez le gro…
-#> # ℹ 14 more variables: `label::Arabic (ar)` <chr>, `hint::English (en)` <chr>,
-#> # `hint::Spanish (es)` <chr>, `hint::French (fr)` <chr>,
-#> # `hint::Arabic (ar)` <chr>, required <chr>, appearance <chr>,
-#> # choice_filter <chr>, calculation <chr>, relevant <chr>, constraint <chr>,
-#> # constraint_message <chr>, repeat_count <chr>, `$given_name` <chr>
+#> # A tibble: 6 × 33
+#> referential_id type name label hint required required_message constraint
+#> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr>
+#> 1 household_survey date inte… Plea… NA false NA NA
+#> 2 household_survey selec… Bure… Plea… Read… true NA NA
+#> 3 household_survey selec… Coun… Plea… Read… true NA NA
+#> 4 household_survey calcu… coun… NA NA false NA NA
+#> 5 household_survey geopo… geop… Reco… NA false NA NA
+#> 6 household_survey selec… pop_… Plea… Read… true NA NA
+#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
+#> # appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
+#> # repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
+#> # `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
+#> # contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
+#> # sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
+#> # subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
#>
#> $information
-#> # A tibble: 2 × 19
-#> type name `label::English (en)` `label::Spanish (es)` `label::French (fr)`
-#> <chr> <chr> <chr> <chr> <chr>
-#> 1 begin_… grou… Interview visits Visitas del entrevis… Visites d'enquête
-#> 2 end_gr… NA NA NA NA
-#> # ℹ 14 more variables: `label::Arabic (ar)` <chr>, `hint::English (en)` <chr>,
-#> # `hint::Spanish (es)` <chr>, `hint::French (fr)` <chr>,
-#> # `hint::Arabic (ar)` <chr>, required <chr>, appearance <chr>,
-#> # choice_filter <chr>, calculation <chr>, relevant <chr>, constraint <chr>,
-#> # constraint_message <chr>, repeat_count <chr>, `$given_name` <chr>
+#> # A tibble: 2 × 33
+#> referential_id type name label hint required required_message constraint
+#> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr>
+#> 1 household_survey begin… grou… Inte… NA false NA NA
+#> 2 household_survey end_g… NA NA NA NA NA NA
+#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
+#> # appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
+#> # repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
+#> # `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
+#> # contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
+#> # sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
+#> # subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
#>
get_choices_for_question(data, indicator, lg)
get_choices_for_question(survey, full_name)
data of choices
data from the choices sheet
the name of the indicator for the question
language to use
the full name (i.e. concatenating groups) for the variable
data form the survey sheet
data from the survey sheet
Referential class is a class to load, check and manipulate the XLSForm
Get choices for one question
get_groups()
Get groups form begin and end into a list with data and information
Referential class is a class to load, check and manipulate the XLSForm
arguments to pass to golem_opts. +
arguments to pass to golem_opts. See `?golem::get_golem_options` for more details.