Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mwanaApp
Title: mwana GUI
Version: 0.1.0
Version: 0.2.0
Authors@R:
person(given = "Tomás",
family = "Zaba",
Expand Down
22 changes: 21 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# mwanaApp 0.2.0

### New features ✨

+ Enabled estimation of age in months from the date of data collection and the
child’s date of birth, and added a corresponding note in the user guide.

### General updates

+ Revised the documentation for the app’s user‑interface and server modules.

### Bug fixes

+ Resolved an issue in which the app’s user interface failed to display the input
field for supplying survey weights in the weight‑for‑height- and combined‑prevalence
tabs.

+ Resolved an issue where hyperlinks in the app were directing users to a
non‑existent page.

## mwanaApp v0.1.0

+ First release of a feature-complete app.
+ First release of a feature-complete app.
10 changes: 6 additions & 4 deletions R/module-data-upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#'
#'
#' @param id Module ID
#'
#' @rdname module-id
#'
#' @keywords internal
#'
#'
#'
module_ui_upload <- function(id) {
## Namespace ID's ----
Expand Down Expand Up @@ -94,9 +95,10 @@ module_ui_upload <- function(id) {
#'
#' Module server for data upload
#'
#' @rdname module-id
#'
#' @param id Module ID
#'
#' @returns A reactive data object to be used in data wrangling tab.
#'
#' @keywords internal
#'
#'
Expand Down
13 changes: 8 additions & 5 deletions R/module-data-wrangling.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#'
#' Module UI for data wrangling
#'
#' @param id Module ID
#'
#' @rdname module-id
#'
#' @keywords internal
#'
Expand Down Expand Up @@ -64,7 +63,7 @@ module_ui_wrangling <- function(id) {
style = "font-size: 15px; font-weight: bold;"
)),

#### A Placehoder for wrangled data and embed user feedback ----
#### A Placeholder for wrangled data and embed user feedback ----
shinycssloaders::withSpinner(
ui_element = DT::DTOutput(outputId = ns("wrangled")),
type = 8,
Expand All @@ -82,7 +81,7 @@ module_ui_wrangling <- function(id) {
)
),

#### Placeholder for donwload button ----
#### Placeholder for download button ----
shiny::uiOutput(outputId = ns("download_wrangled_data"))
)
)
Expand All @@ -98,7 +97,11 @@ module_ui_wrangling <- function(id) {
#' Module server for data wrangling
#'
#' @param id Module ID
#'
#'
#' @param data An output and reactive data object from previous tab.
#'
#' @returns A reactive data object wrangled and ready to be used in plausibility
#' checks and prevalence analysis tabs.
#'
#' @keywords internal
#'
Expand Down
13 changes: 11 additions & 2 deletions R/module-helpers-data-wrangling.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
#'
#'
#' Display input variables dynamically, according to UI for screening
#'
#'
#'
#' @param vars An object holding the data variable names. This is used to display
#' all the variables in the input variable of the ui.
#'
#' @param method User-selected method for data wrangling.
#'
#' @param ns A placeholder for Shiny module namespace.
#'
#' @returns A set of input variables specific for the user-selected data-wrangling
#' method.
#'
#' @keywords internal
#'
#'
Expand Down
21 changes: 19 additions & 2 deletions R/module-helpers-ipc-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
#'
#'
#' Display input variables dynamically, according to UI for screening
#'
#' @param vars An object holding the data variable names. This is used to display
#' all the variables in the input variable of the UI.
#'
#' @param source User-selected source of data. As in the underlying method
#' used to collect the data. Choices are survey, screening and sentinel.
#'
#'
#' @param ns A placeholder for Shiny module namespace.
#'
#' @returns A set of input variables specific for the user-selected source of
#' data.
#'
#' @keywords internal
#'
#'
Expand Down Expand Up @@ -103,7 +113,14 @@ mod_ipccheck_display_input_variables <- function(vars, source, ns) {
#' Invoke mwana's IPC Acute Malnutrition minimum sample size requirement checker
#' from within the module server
#'
#'
#' @param df,cluster,source,area1,area2 Input variables collected from the UI
#' and required to pass to mwana::mw_check_ipcamn_ssreq() function.
#'
#' @returns A summary tibble containing check results for:
#' + n_clusters - the total number of unique clusters or screening or site identifiers;
#' + n_obs - the corresponding total number of children in the dataset; and,
#' + meet_ipc - whether the IPC AMN requirements were met.
#'
#' @keywords internal
#'
#'
Expand Down
14 changes: 10 additions & 4 deletions R/module-helpers-plausibility-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#'
#' Display input variables dynamically, according to UI for screening
#'
#' @keywords internal
#' @inheritParams mod_data_wrangling_display_input_variables
#'
#'
mod_plausibility_display_input_variables <- function(vars, method, ns) {
### Base inputs always shown
Expand Down Expand Up @@ -132,16 +133,21 @@ mod_plausibility_display_input_variables <- function(vars, method, ns) {
inputs_vars
}


#'
#'
#' Invoke mwana's plausibility checkers dynamically from within module server,
#' according to user specifications in the UI
#'
#'
#' @param df,age,sex,muac,weight,height,flags,area1,area2,area3,.for Input
#' variables collected from the UI and required to pass to
#' mwana::mw_plausibility_check_wfhz().
#'
#' @returns A single-row summary tibble with columns containing the plausibility
#' check results.
#'
#' @keywords internal
#'
#'
#'
mod_plausibility_call_checker <- function(
df, age = NULL, sex, muac = NULL, weight = NULL,
height = NULL, flags, area1, area2, area3, .for = c("wfhz", "muac", "mfaz")) {
Expand Down
49 changes: 46 additions & 3 deletions R/module-helpers-prevalence.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
#'
#'
#' Display input variables dynamically, according to UI for screening
#'
#'
#' @param vars,source,indicator_surv,has_age Input variables collected
#' from the UI and required to pass to `{mwana}` prevalence functions.
#'
#' @param ns A placeholder for Shiny module namespace.
#'
#' @keywords internal
#'
Expand Down Expand Up @@ -154,6 +160,11 @@ mod_prevalence_display_input_variables <- function(
#'
#' Invoke mwana's prevalence functions from within module server according to
#' user specifications in the UI
#'
#' @param df,wts,oedema,area1,area2,area3 Input variables collected from the UI
#' and required to pass to mwana::mw_estimate_prevalence_wfhz().
#'
#' @returns A summary tibble for the descriptive statistics about wasting.
#'
#' @keywords internal
#'
Expand All @@ -180,12 +191,19 @@ mod_prevalence_call_wfhz_prev_estimator <- function(
)
}


#'
#'
#'
#' Invoke mwana's prevalence functions from within module server according to
#' user specifications in the UI
#'
#' @param df,age,muac,wts,oedema,area1,area2,area3 Input variables collected
#' from the UI and required to pass to mwana::mw_estimate_prevalence_muac().
#'
#' @returns A summary tibble for the descriptive statistics about wasting based
#' on MUAC, with confidence intervals.
#'
#' @keywords internal
#'
#'
Expand Down Expand Up @@ -213,13 +231,14 @@ mod_prevalence_call_muac_prev_estimator <- function(
)
}


#'
#'
#'
#' Invoke mwana's prevalence functions from within module server according to
#' user specifications in the UI
#'
#' @keywords internal
#' @inheritParams mod_prevalence_call_wfhz_prev_estimator
#'
#'
mod_prevalence_call_combined_prev_estimator <- function(
Expand Down Expand Up @@ -250,11 +269,16 @@ mod_prevalence_call_combined_prev_estimator <- function(
#'
#' Invoke mwana's prevalence functions from within module server according to
#' user specifications in the UI
#'
#' @param df,age,muac,oedema,area1,area2,area3 Input variables collected
#' from the UI and required to pass to mwana::mw_estimate_prevalence_screening().
#
#' @returns A summary tibble for the descriptive statistics about wasting based
#' on MUAC, with no confidence intervals.
#'
#' @keywords internal
#'
#'
#'
mod_prevalence_call_prev_estimator_screening <- function(
df, age, muac, oedema = NULL,
area1, area2, area3) {
Expand Down Expand Up @@ -293,10 +317,14 @@ mod_prevalence_call_prev_estimator_screening <- function(
#' Invoke mwana's prevalence functions from within module server according to
#' user specifications in the UI
#'
#' @param df,age_cat,muac,oedema,area1,area2,area3 Input variables collected
#' from the UI and required to pass to mwana::mw_estimate_prevalence_screening2()
#'
#' @returns A summary tibble for the descriptive statistics about wasting based
#' on MUAC, with no confidence intervals.
#'
#' @keywords internal
#'
#'
mod_prevalence_call_prev_estimator_screening2 <- function(
df, age_cat, muac, oedema = NULL,
area1, area2, area3) {
Expand Down Expand Up @@ -329,6 +357,14 @@ mod_prevalence_call_prev_estimator_screening2 <- function(

#'
#'
#' Neat prevalence output from survey
#'
#' @param df data.frame containing the prevalence results.
#' @param .type A choice from which the prevalence is derived.
#'
#' @returns A tibble object of the same length and width as df, with column
#' names and values formatted for clarity and readability.
#'
#' @keywords internal
#'
#'
Expand Down Expand Up @@ -393,6 +429,13 @@ mod_prevalence_neat_output_survey <- function(


#'
#'
#' Neat prevalence output from survey
#'
#' @param df data.frame containing the prevalence results.
#'
#' @returns A tibble object of the same length and width as df, with column
#' names and values formatted for clarity and readability.
#'
#' @keywords internal
#'
Expand Down
14 changes: 4 additions & 10 deletions R/module-ipc-aman-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#'
#' @keywords internal
#'
#'
#'
module_ui_ipccheck <- function(id) {
## Namespace ID ----
ns <- shiny::NS(id)
Expand Down Expand Up @@ -79,25 +77,21 @@ module_ui_ipccheck <- function(id) {
)
),

#### Placeholder for donwload button ----
#### Placeholder for download button ----
shiny::uiOutput(outputId = ns("download_ipccheck"))
)
)
)
}


## ---- Module: Sever ----------------------------------------------------------
## ---- Module: Server ----------------------------------------------------------

#'
#'
#' Module server for IPC Acute Malnutrition sample size requirements check
#'
#' @param id Module ID
#'
#'
#' @keywords internal
#'
#' @inheritParams module_server_wrangling
#'
#'
module_server_ipccheck <- function(id, data) {
Expand Down Expand Up @@ -204,7 +198,7 @@ module_server_ipccheck <- function(id, data) {
pageLength = 20,
scrollX = FALSE,
scrollY = "800px",
columDefs = list(list(className = "dt-center", targets = "_all"))
columnDefs = list(list(className = "dt-center", targets = "_all"))
),
caption = if (nrow(dataset$checked) > 20) {
paste(
Expand Down
Loading
Loading