mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-15 00:52:09 +01:00
refined missingness evaluation
This commit is contained in:
parent
af523edc00
commit
35afbc1dc9
21 changed files with 1377 additions and 779 deletions
12
CITATION.cff
12
CITATION.cff
|
|
@ -1116,6 +1116,18 @@ references:
|
|||
orcid: https://orcid.org/0000-0002-0172-3812
|
||||
year: '2025'
|
||||
doi: 10.32614/CRAN.package.data.table
|
||||
- type: software
|
||||
title: viridis
|
||||
abstract: 'viridis: Colorblind-Friendly Color Maps for R'
|
||||
notes: Imports
|
||||
url: https://sjmgarnier.github.io/viridis/
|
||||
repository: https://CRAN.R-project.org/package=viridis
|
||||
authors:
|
||||
- family-names: Garnier
|
||||
given-names: Simon
|
||||
email: garnier@njit.edu
|
||||
year: '2025'
|
||||
doi: 10.32614/CRAN.package.viridis
|
||||
- type: software
|
||||
title: styler
|
||||
abstract: 'styler: Non-Invasive Pretty Printing of R Code'
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ Imports:
|
|||
NHANES,
|
||||
shiny.i18n,
|
||||
stRoke,
|
||||
data.table
|
||||
data.table,
|
||||
viridis
|
||||
Suggests:
|
||||
styler,
|
||||
devtools,
|
||||
|
|
|
|||
|
|
@ -75,15 +75,15 @@ data_missings_server <- function(id,
|
|||
shiny::req(data())
|
||||
vectorSelectInput(
|
||||
inputId = ns("missings_method"),
|
||||
label = i18n$t("Select missings analysis to apply"),
|
||||
label = i18n$t("Analysis method for missingness overview"),
|
||||
choices = setNames(
|
||||
c(
|
||||
"predictors",
|
||||
"outcome"
|
||||
),
|
||||
c(
|
||||
i18n$t("Variables"),
|
||||
i18n$t("By outcome")
|
||||
i18n$t("Overview of missings across variables"),
|
||||
i18n$t("Overview of difference in variables by missing status in outcome")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
@ -96,15 +96,19 @@ data_missings_server <- function(id,
|
|||
shiny::req(input$missings_method)
|
||||
# browser()
|
||||
if (input$missings_method == "predictors") {
|
||||
label <- i18n$t("Select a variable for grouped overview")
|
||||
df <- data_type_filter(data(), type = c("categorical", "dichotomous"))
|
||||
col_subset <- c("none", names(df))
|
||||
} else {
|
||||
label <- i18n$t("Select outcome variable for overview")
|
||||
df <- datar()[apply(datar(), 2, anyNA)]
|
||||
col_subset <- names(df)
|
||||
}
|
||||
columnSelectInput(
|
||||
inputId = ns("missings_var"),
|
||||
label = i18n$t("Select variable to stratify analysis"),
|
||||
label = label,
|
||||
data = df,
|
||||
col_subset = c("none", names(df)),
|
||||
col_subset = col_subset,
|
||||
none_label = i18n$t("No variable")
|
||||
)
|
||||
})
|
||||
|
|
@ -144,7 +148,11 @@ data_missings_server <- function(id,
|
|||
# if (is.null(variabler()) || variabler() == "" || !variabler() %in% names(data()) || variabler() == "none") {
|
||||
# tbl <- rv$data()
|
||||
if (anyNA(datar())) {
|
||||
title <- i18n$t("No variable chosen for analysis")
|
||||
if (input$missings_method == "predictors") {
|
||||
title <- i18n$t("Overview of missing observations")
|
||||
} else {
|
||||
title <- i18n$t("No outcome measure chosen")
|
||||
}
|
||||
} else {
|
||||
title <- i18n$t("No missing observations")
|
||||
}
|
||||
|
|
|
|||
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
|
|
@ -335,7 +335,7 @@ validation_lib <- function(name = NULL) {
|
|||
"mcar" = function(x, y) {
|
||||
### Placeholder for missingness validation
|
||||
list(
|
||||
string = i18n$t("There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."),
|
||||
string = i18n$t("There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."),
|
||||
summary.fun = mcar_validate,
|
||||
summary.fun.args = list(
|
||||
data = x,
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
|cardx |0.3.1 |2025-12-04 |CRAN (R 4.4.3) |
|
||||
|caTools |1.18.3 |2024-09-04 |CRAN (R 4.4.1) |
|
||||
|cellranger |1.1.0 |2016-07-27 |CRAN (R 4.4.0) |
|
||||
|cffr |1.2.0 |2025-01-25 |CRAN (R 4.4.1) |
|
||||
|checkmate |2.3.3 |2025-08-18 |CRAN (R 4.4.1) |
|
||||
|class |7.3-23 |2025-01-01 |CRAN (R 4.4.1) |
|
||||
|classInt |0.4-11 |2025-01-08 |CRAN (R 4.4.1) |
|
||||
|
|
@ -53,6 +54,7 @@
|
|||
|colorspace |2.1-2 |2025-09-22 |CRAN (R 4.4.1) |
|
||||
|commonmark |2.0.0 |2025-07-07 |CRAN (R 4.4.1) |
|
||||
|crayon |1.5.3 |2024-06-20 |CRAN (R 4.4.1) |
|
||||
|curl |7.0.0 |2025-08-19 |CRAN (R 4.4.1) |
|
||||
|data.table |1.17.8 |2025-07-10 |CRAN (R 4.4.1) |
|
||||
|datamods |1.5.3 |2024-10-02 |CRAN (R 4.4.1) |
|
||||
|datawizard |1.3.0 |2025-10-11 |CRAN (R 4.4.1) |
|
||||
|
|
@ -111,6 +113,7 @@
|
|||
|iterators |1.0.14 |2022-02-05 |CRAN (R 4.4.1) |
|
||||
|jquerylib |0.1.4 |2021-04-26 |CRAN (R 4.4.0) |
|
||||
|jsonlite |2.0.0 |2025-03-27 |CRAN (R 4.4.1) |
|
||||
|jsonvalidate |1.5.0 |2025-02-07 |CRAN (R 4.4.1) |
|
||||
|KernSmooth |2.23-26 |2025-01-01 |CRAN (R 4.4.1) |
|
||||
|keyring |1.4.1 |2025-06-15 |CRAN (R 4.4.1) |
|
||||
|knitr |1.50 |2025-03-16 |CRAN (R 4.4.1) |
|
||||
|
|
@ -138,6 +141,7 @@
|
|||
|openssl |2.3.4 |2025-09-30 |CRAN (R 4.4.1) |
|
||||
|openxlsx2 |1.22 |2025-12-07 |CRAN (R 4.4.3) |
|
||||
|otel |0.2.0 |2025-08-29 |CRAN (R 4.4.1) |
|
||||
|pak |0.9.1 |2025-12-01 |CRAN (R 4.4.3) |
|
||||
|parameters |0.28.3 |2025-11-25 |CRAN (R 4.4.3) |
|
||||
|patchwork |1.3.2 |2025-08-25 |CRAN (R 4.4.1) |
|
||||
|pbmcapply |1.5.1 |2022-04-28 |CRAN (R 4.4.1) |
|
||||
|
|
@ -165,6 +169,7 @@
|
|||
|R6 |2.6.1 |2025-02-15 |CRAN (R 4.4.1) |
|
||||
|ragg |1.5.0 |2025-09-02 |CRAN (R 4.4.1) |
|
||||
|rankinPlot |1.1.0 |2023-01-30 |CRAN (R 4.4.0) |
|
||||
|rappdirs |0.3.3 |2021-01-31 |CRAN (R 4.4.1) |
|
||||
|rbibutils |2.4 |2025-11-07 |CRAN (R 4.4.1) |
|
||||
|RColorBrewer |1.1-3 |2022-04-03 |CRAN (R 4.4.1) |
|
||||
|Rcpp |1.1.0 |2025-07-02 |CRAN (R 4.4.1) |
|
||||
|
|
@ -221,7 +226,10 @@
|
|||
|usethis |3.2.1 |2025-09-06 |CRAN (R 4.4.1) |
|
||||
|utf8 |1.2.6 |2025-06-08 |CRAN (R 4.4.1) |
|
||||
|uuid |1.2-1 |2024-07-29 |CRAN (R 4.4.1) |
|
||||
|V8 |8.0.1 |2025-10-10 |CRAN (R 4.4.1) |
|
||||
|vctrs |0.6.5 |2023-12-01 |CRAN (R 4.4.0) |
|
||||
|viridis |0.6.5 |2024-01-29 |CRAN (R 4.4.0) |
|
||||
|viridisLite |0.4.2 |2023-05-02 |CRAN (R 4.4.1) |
|
||||
|vroom |1.6.7 |2025-11-28 |CRAN (R 4.4.3) |
|
||||
|withr |3.0.2 |2024-10-28 |CRAN (R 4.4.1) |
|
||||
|writexl |1.5.4 |2025-04-15 |CRAN (R 4.4.1) |
|
||||
|
|
|
|||
463
app_docker/app.R
463
app_docker/app.R
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
########
|
||||
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpejDCIE/filec7542b7ed14.R
|
||||
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpT9sPX5/file6c80650aba81.R
|
||||
########
|
||||
|
||||
i18n_path <- here::here("translations")
|
||||
|
|
@ -49,6 +49,7 @@ library(shiny.i18n)
|
|||
## Translation init
|
||||
i18n <- shiny.i18n::Translator$new(translation_csvs_path = i18n_path)
|
||||
|
||||
# i18n <- shiny.i18n::Translator$new(translation_csvs_path = here::here("inst/translations/"))
|
||||
i18n$set_translation_language("en")
|
||||
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ i18n$set_translation_language("en")
|
|||
#### Current file: /Users/au301842/FreesearchR/R//app_version.R
|
||||
########
|
||||
|
||||
app_version <- function()'25.12.2'
|
||||
app_version <- function()'25.12.3'
|
||||
|
||||
|
||||
########
|
||||
|
|
@ -856,8 +857,18 @@ make_choices_with_infos <- function(data) {
|
|||
#' @importFrom shiny selectizeInput
|
||||
#' @export
|
||||
#'
|
||||
columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
||||
col_subset = NULL, placeholder = "", onInitialize, none_label="No variable selected",maxItems=NULL) {
|
||||
columnSelectInput <- function(
|
||||
inputId,
|
||||
label,
|
||||
data,
|
||||
selected = "",
|
||||
...,
|
||||
col_subset = NULL,
|
||||
placeholder = "",
|
||||
onInitialize,
|
||||
none_label = "No variable selected",
|
||||
maxItems = NULL
|
||||
) {
|
||||
datar <- if (is.reactive(data)) data else reactive(data)
|
||||
col_subsetr <- if (is.reactive(col_subset)) col_subset else reactive(col_subset)
|
||||
|
||||
|
|
@ -877,8 +888,8 @@ columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
|||
)
|
||||
}, col = names(datar()))
|
||||
|
||||
if (!"none" %in% names(datar())){
|
||||
labels <- c("none"=list(sprintf('\n {\n \"name\": \"none\",\n \"label\": \"%s\",\n \"dataclass\": \"\",\n \"datatype\": \"\"\n }',none_label)),labels)
|
||||
if (!"none" %in% names(datar())) {
|
||||
labels <- c("none" = list(sprintf('\n {\n \"name\": \"none\",\n \"label\": \"%s\",\n \"dataclass\": \"\",\n \"datatype\": \"\"\n }', none_label)), labels)
|
||||
choices <- setNames(names(labels), labels)
|
||||
choices <- choices[match(if (length(col_subsetr()) == 0 || isTRUE(col_subsetr() == "")) names(datar()) else col_subsetr(), choices)]
|
||||
} else {
|
||||
|
|
@ -922,7 +933,7 @@ columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
|||
'</div>';
|
||||
}
|
||||
}")),
|
||||
if (!is.null(maxItems)) list(maxItems=maxItems)
|
||||
if (!is.null(maxItems)) list(maxItems = maxItems)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
@ -943,31 +954,31 @@ columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
|||
#'
|
||||
#' @examples
|
||||
#' if (shiny::interactive()) {
|
||||
#' shinyApp(
|
||||
#' ui = fluidPage(
|
||||
#' shiny::uiOutput("select"),
|
||||
#' tableOutput("data")
|
||||
#' ),
|
||||
#' server = function(input, output) {
|
||||
#' output$select <- shiny::renderUI({
|
||||
#' vectorSelectInput(
|
||||
#' inputId = "variable", label = "Variable:",
|
||||
#' data = c(
|
||||
#' "Cylinders" = "cyl",
|
||||
#' "Transmission" = "am",
|
||||
#' "Gears" = "gear"
|
||||
#' shinyApp(
|
||||
#' ui = fluidPage(
|
||||
#' shiny::uiOutput("select"),
|
||||
#' tableOutput("data")
|
||||
#' ),
|
||||
#' server = function(input, output) {
|
||||
#' output$select <- shiny::renderUI({
|
||||
#' vectorSelectInput(
|
||||
#' inputId = "variable", label = "Variable:",
|
||||
#' data = c(
|
||||
#' "Cylinders" = "cyl",
|
||||
#' "Transmission" = "am",
|
||||
#' "Gears" = "gear"
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#' })
|
||||
#' })
|
||||
#'
|
||||
#' output$data <- renderTable(
|
||||
#' {
|
||||
#' mtcars[, c("mpg", input$variable), drop = FALSE]
|
||||
#' },
|
||||
#' rownames = TRUE
|
||||
#' )
|
||||
#' }
|
||||
#' )
|
||||
#' output$data <- renderTable(
|
||||
#' {
|
||||
#' mtcars[, c("mpg", input$variable), drop = FALSE]
|
||||
#' },
|
||||
#' rownames = TRUE
|
||||
#' )
|
||||
#' }
|
||||
#' )
|
||||
#' }
|
||||
vectorSelectInput <- function(inputId,
|
||||
label,
|
||||
|
|
@ -1022,8 +1033,6 @@ vectorSelectInput <- function(inputId,
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
########
|
||||
#### Current file: /Users/au301842/FreesearchR/R//cut_var.R
|
||||
########
|
||||
|
|
@ -2662,7 +2671,7 @@ create_plot <- function(data, type, pri, sec, ter = NULL, ...) {
|
|||
out
|
||||
}
|
||||
|
||||
#' Print label, and if missing print variable name
|
||||
#' Print label, and if missing print variable name for plots
|
||||
#'
|
||||
#' @param data vector or data frame
|
||||
#' @param var variable name. Optional.
|
||||
|
|
@ -4429,7 +4438,7 @@ data_types <- function() {
|
|||
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
|
||||
########
|
||||
|
||||
hosted_version <- function()'v25.12.2-251203'
|
||||
hosted_version <- function()'v25.12.3-251211'
|
||||
|
||||
|
||||
########
|
||||
|
|
@ -5521,18 +5530,46 @@ launch_FreesearchR <- function(...){
|
|||
#' Data correlations evaluation module
|
||||
#'
|
||||
#' @param id Module id
|
||||
#' @param ... additional UI elements to show before the table overview
|
||||
#'
|
||||
#' @name data-missings
|
||||
#' @returns Shiny ui module
|
||||
#' @export
|
||||
data_missings_ui <- function(id) {
|
||||
data_missings_ui <- function(id, ...) {
|
||||
ns <- shiny::NS(id)
|
||||
|
||||
shiny::tagList(
|
||||
gt::gt_output(outputId = ns("missings_table"))
|
||||
list(
|
||||
bslib::layout_sidebar(
|
||||
sidebar = bslib::sidebar(
|
||||
bslib::accordion(
|
||||
id = ns("acc_mis"),
|
||||
open = "acc_chars",
|
||||
multiple = FALSE,
|
||||
bslib::accordion_panel(
|
||||
value = "acc_pan_mis",
|
||||
title = "Settings",
|
||||
icon = bsicons::bs_icon("x-circle"),
|
||||
shiny::uiOutput(ns("missings_method")),
|
||||
shiny::uiOutput(ns("missings_var")),
|
||||
shiny::helpText(i18n$t("Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.")),
|
||||
shiny::br(),
|
||||
shiny::actionButton(
|
||||
inputId = ns("act_miss"),
|
||||
label = i18n$t("Evaluate"),
|
||||
width = "100%",
|
||||
icon = shiny::icon("calculator"),
|
||||
disabled = FALSE
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
...,
|
||||
gt::gt_output(outputId = ns("missings_table"))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
## This should really just be rebuild to only contain a function
|
||||
|
||||
#'
|
||||
#' @param data data
|
||||
|
|
@ -5543,108 +5580,200 @@ data_missings_ui <- function(id) {
|
|||
#' @export
|
||||
data_missings_server <- function(id,
|
||||
data,
|
||||
variable,
|
||||
max_level=20,
|
||||
max_level = 20,
|
||||
...) {
|
||||
shiny::moduleServer(
|
||||
id = id,
|
||||
module = function(input, output, session) {
|
||||
# ns <- session$ns
|
||||
ns <- session$ns
|
||||
|
||||
datar <- if (is.reactive(data)) data else reactive(data)
|
||||
variabler <- if (is.reactive(variable)) variable else reactive(variable)
|
||||
|
||||
rv <- shiny::reactiveValues(
|
||||
data = NULL,
|
||||
table = NULL
|
||||
)
|
||||
|
||||
rv$data <- shiny::reactive({
|
||||
df_tbl <- datar()
|
||||
by_var <- variabler()
|
||||
## Notes
|
||||
##
|
||||
## Code export is still missing
|
||||
## Direct table export would be nice
|
||||
|
||||
tryCatch(
|
||||
{
|
||||
out <- compare_missings(df_tbl,by_var,max_level = max_level)
|
||||
},
|
||||
error = function(err) {
|
||||
showNotification(paste0("Error: ", err), type = "err")
|
||||
}
|
||||
)
|
||||
shiny::observe(
|
||||
output$missings_method <- shiny::renderUI({
|
||||
shiny::req(data())
|
||||
vectorSelectInput(
|
||||
inputId = ns("missings_method"),
|
||||
label = i18n$t("Analysis method for missingness overview"),
|
||||
choices = setNames(
|
||||
c(
|
||||
"predictors",
|
||||
"outcome"
|
||||
),
|
||||
c(
|
||||
i18n$t("Overview of missings across variables"),
|
||||
i18n$t("Overview of difference in variables by missing status in outcome")
|
||||
)
|
||||
)
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
out
|
||||
})
|
||||
|
||||
output$missings_table <- gt::render_gt({
|
||||
shiny::req(datar)
|
||||
shiny::req(variabler)
|
||||
|
||||
if (is.null(variabler()) || variabler() == "" || !variabler() %in% names(datar())) {
|
||||
tbl <- rv$data()
|
||||
if (anyNA(datar())){
|
||||
title <- i18n$t("No variable chosen for analysis")
|
||||
shiny::observe({
|
||||
output$missings_var <- shiny::renderUI({
|
||||
shiny::req(datar())
|
||||
shiny::req(input$missings_method)
|
||||
# browser()
|
||||
if (input$missings_method == "predictors") {
|
||||
label <- i18n$t("Select a variable for grouped overview")
|
||||
df <- data_type_filter(data(), type = c("categorical", "dichotomous"))
|
||||
col_subset <- c("none", names(df))
|
||||
} else {
|
||||
title <- i18n$t("No missing observations")
|
||||
label <- i18n$t("Select outcome variable for overview")
|
||||
df <- datar()[apply(datar(), 2, anyNA)]
|
||||
col_subset <- names(df)
|
||||
}
|
||||
} else {
|
||||
tbl <- rv$data()|>
|
||||
gtsummary::bold_p()
|
||||
title <- glue::glue(i18n$t("Missing vs non-missing observations in the variable **'{variabler()}'**"))
|
||||
}
|
||||
|
||||
out <- tbl |>
|
||||
gtsummary::as_gt() |>
|
||||
gt::tab_header(title = gt::md(title))
|
||||
|
||||
rv$table <- out
|
||||
|
||||
out
|
||||
columnSelectInput(
|
||||
inputId = ns("missings_var"),
|
||||
label = label,
|
||||
data = df,
|
||||
col_subset = col_subset,
|
||||
none_label = i18n$t("No variable")
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
return(reactive(rv$table))
|
||||
|
||||
shiny::observeEvent(
|
||||
list(input$act_miss),
|
||||
{
|
||||
shiny::req(datar())
|
||||
shiny::req(input$missings_var)
|
||||
# browser()
|
||||
df_tbl <- datar()
|
||||
by_var <- input$missings_var
|
||||
|
||||
parameters <- list(
|
||||
by_var = by_var,
|
||||
max_level = max_level,
|
||||
type = input$missings_method
|
||||
)
|
||||
|
||||
tryCatch(
|
||||
{
|
||||
shiny::withProgress(message = i18n$t("Calculating. Hold tight for a moment.."), {
|
||||
out <- do.call(
|
||||
compare_missings,
|
||||
modifyList(parameters, list(data = df_tbl))
|
||||
)
|
||||
})
|
||||
},
|
||||
error = function(err) {
|
||||
showNotification(paste0("Error: ", err), type = "err")
|
||||
}
|
||||
)
|
||||
|
||||
if (is.null(input$missings_var) || input$missings_var == "" || !input$missings_var %in% names(datar()) || input$missings_var == "none") {
|
||||
# if (is.null(variabler()) || variabler() == "" || !variabler() %in% names(data()) || variabler() == "none") {
|
||||
# tbl <- rv$data()
|
||||
if (anyNA(datar())) {
|
||||
if (input$missings_method == "predictors") {
|
||||
title <- i18n$t("Overview of missing observations")
|
||||
} else {
|
||||
title <- i18n$t("No outcome measure chosen")
|
||||
}
|
||||
} else {
|
||||
title <- i18n$t("No missing observations")
|
||||
}
|
||||
} else {
|
||||
## Due to reactivity, the table updates too quickly. this mitigates that issue..
|
||||
|
||||
|
||||
if (input$missings_var == "predictors") {
|
||||
title <- glue::glue(i18n$t("Missings across variables by the variable **'{input$missings_var}'**"))
|
||||
} else {
|
||||
title <- glue::glue(i18n$t("Missing vs non-missing observations in the variable **'{input$missings_var}'**"))
|
||||
}
|
||||
}
|
||||
|
||||
attr(out, "tbl_title") <- title
|
||||
|
||||
rv$data <- shiny::reactive(out)
|
||||
}
|
||||
)
|
||||
|
||||
shiny::observeEvent(
|
||||
list(
|
||||
# input$act_miss
|
||||
rv$data
|
||||
),
|
||||
{
|
||||
output$missings_table <- gt::render_gt({
|
||||
shiny::req(rv$data)
|
||||
# shiny::req(input$missings_var)
|
||||
# browser()
|
||||
if ("p.value" %in% names(rv$data()[["table_body"]])) {
|
||||
tbl <- rv$data() |>
|
||||
gtsummary::bold_p()
|
||||
} else {
|
||||
tbl <- rv$data()
|
||||
}
|
||||
|
||||
|
||||
out <- tbl |>
|
||||
gtsummary::as_gt() |>
|
||||
gt::tab_header(title = gt::md(attr(tbl, "tbl_title")))
|
||||
|
||||
attr(out, "strat_var") <- input$missings_var
|
||||
|
||||
rv$table <- out
|
||||
|
||||
out
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
return(shiny::reactive(rv$table))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
missing_demo_app <- function() {
|
||||
ui <- shiny::fluidPage(
|
||||
shiny::actionButton(
|
||||
inputId = "modal_missings",
|
||||
label = "Browse data",
|
||||
width = "100%",
|
||||
disabled = FALSE
|
||||
),
|
||||
shiny::selectInput(
|
||||
inputId = "missings_var",
|
||||
label = "Select variable to stratify analysis", choices = c("cyl", "vs")
|
||||
),
|
||||
data_missings_ui("data")
|
||||
ui <- do.call(
|
||||
bslib::page,
|
||||
c(
|
||||
list(
|
||||
title = i18n$t("Missings"),
|
||||
icon = bsicons::bs_icon("x-circle")
|
||||
),
|
||||
data_missings_ui(id = "data")
|
||||
)
|
||||
)
|
||||
server <- function(input, output, session) {
|
||||
data_demo <- mtcars
|
||||
data_demo[sample(1:32, 10), "cyl"] <- NA
|
||||
data_demo[sample(1:32, 8), "vs"] <- NA
|
||||
|
||||
data_missings_server(id = "data", data = data_demo, variable = shiny::reactive(input$missings_var))
|
||||
data_missings_server(id = "data", data = data_demo)
|
||||
|
||||
visual_summary_server(id = "visual", data = data_demo)
|
||||
# visual_summary_server(id = "visual", data = data_demo)
|
||||
|
||||
observeEvent(input$modal_missings, {
|
||||
tryCatch(
|
||||
{
|
||||
modal_visual_summary(id = "visual")
|
||||
},
|
||||
error = function(err) {
|
||||
showNotification(paste0("We encountered the following error browsing your data: ", err), type = "err")
|
||||
}
|
||||
)
|
||||
})
|
||||
# observeEvent(input$modal_missings, {
|
||||
# tryCatch(
|
||||
# {
|
||||
# modal_visual_summary(id = "visual")
|
||||
# },
|
||||
# error = function(err) {
|
||||
# showNotification(paste0("We encountered the following error browsing your data: ", err), type = "err")
|
||||
# }
|
||||
# )
|
||||
# })
|
||||
}
|
||||
shiny::shinyApp(ui, server)
|
||||
}
|
||||
|
||||
missing_demo_app()
|
||||
# missing_demo_app()
|
||||
|
||||
#' Pairwise comparison of missings across covariables
|
||||
#'
|
||||
|
|
@ -5654,28 +5783,80 @@ missing_demo_app()
|
|||
#' @returns gtsummary list object
|
||||
#' @export
|
||||
#'
|
||||
compare_missings <- function(data,by_var,max_level=20){
|
||||
compare_missings <- function(
|
||||
data,
|
||||
by_var,
|
||||
max_level = 20,
|
||||
type = c("predictors", "outcome")
|
||||
) {
|
||||
type <- match.arg(type)
|
||||
|
||||
if (!is.null(by_var) && by_var != "" && by_var %in% names(data)) {
|
||||
data <- data |>
|
||||
lapply(\(.x){
|
||||
# browser()
|
||||
if (is.factor(.x)){
|
||||
cut_var(.x,breaks=20,type="top")
|
||||
if (is.factor(.x)) {
|
||||
cut_var(.x, breaks = 20, type = "top")
|
||||
} else {
|
||||
.x
|
||||
}
|
||||
}) |> dplyr::bind_cols()
|
||||
}) |>
|
||||
dplyr::bind_cols()
|
||||
|
||||
data[[by_var]] <- ifelse(is.na(data[[by_var]]), "Missing", "Non-missing")
|
||||
if (type == "predictors") {
|
||||
data <- missings_logic_across(data, exclude = by_var)
|
||||
} else {
|
||||
data[[by_var]] <- ifelse(is.na(data[[by_var]]), "Missing", "Non-missing")
|
||||
}
|
||||
|
||||
out <- gtsummary::tbl_summary(data, by = by_var) |>
|
||||
gtsummary::add_p()
|
||||
} else {
|
||||
if (type == "predictors") {
|
||||
data <- missings_logic_across(data)
|
||||
}
|
||||
|
||||
out <- gtsummary::tbl_summary(data)
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
#' Converting all variables to logicals by missing status
|
||||
#'
|
||||
#' @param data data
|
||||
#' @param exclude character vector of variable names to be excluded
|
||||
#'
|
||||
#' @returns data frame
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' mtcars |> missings_logic_across("cyl")
|
||||
#' ## gtsummary::trial |>
|
||||
#' ## missings_logic_across() |>
|
||||
#' ## gtsummary::tbl_summary()
|
||||
missings_logic_across <- function(data, exclude = NULL) {
|
||||
# This function includes a approach way to preserve variable labels
|
||||
names(data) |>
|
||||
lapply(\(.x){
|
||||
# browser()
|
||||
# Saving original labels
|
||||
lab <- REDCapCAST::get_attr(data[[.x]], attr = "label")
|
||||
if (!.x %in% exclude) {
|
||||
out <- is.na(data[[.x]])
|
||||
} else {
|
||||
out <- data[[.x]]
|
||||
}
|
||||
if (!is.na(lab)) {
|
||||
# Restoring original labels, if not NA
|
||||
REDCapCAST::set_attr(data = out, label = lab, attr = "label", overwrite = TRUE)
|
||||
} else {
|
||||
out
|
||||
}
|
||||
}) |>
|
||||
dplyr::bind_cols(.name_repair = "unique_quiet") |>
|
||||
setNames(names(data))
|
||||
}
|
||||
|
||||
|
||||
########
|
||||
#### Current file: /Users/au301842/FreesearchR/R//plot_bar.R
|
||||
|
|
@ -10156,26 +10337,15 @@ ui_elements <- function(selection) {
|
|||
data_correlations_ui(id = "correlations", height = 600)
|
||||
)
|
||||
),
|
||||
bslib::nav_panel(
|
||||
title = i18n$t("Missings"),
|
||||
icon = bsicons::bs_icon("x-circle"),
|
||||
bslib::layout_sidebar(
|
||||
sidebar = bslib::sidebar(
|
||||
bslib::accordion(
|
||||
id = "acc_mis",
|
||||
open = "acc_chars",
|
||||
multiple = FALSE,
|
||||
bslib::accordion_panel(
|
||||
value = "acc_pan_mis",
|
||||
title = "Settings",
|
||||
icon = bsicons::bs_icon("x-circle"),
|
||||
shiny::uiOutput("missings_var"),
|
||||
shiny::helpText(i18n$t("To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random."))
|
||||
)
|
||||
)
|
||||
do.call(
|
||||
bslib::nav_panel,
|
||||
c(
|
||||
list(
|
||||
title = i18n$t("Missings"),
|
||||
icon = bsicons::bs_icon("x-circle")
|
||||
),
|
||||
validation_ui("validation_mcar"),
|
||||
data_missings_ui(id = "missingness")
|
||||
data_missings_ui(id = "missingness",
|
||||
validation_ui("validation_mcar"))
|
||||
)
|
||||
)
|
||||
),
|
||||
|
|
@ -11438,7 +11608,7 @@ convert_to <- function(data,
|
|||
|
||||
#' Get variable(s) to convert
|
||||
#'
|
||||
#' @param vars Output of [summary_vars()]
|
||||
#' @param vars variables, output from summary_vars() function
|
||||
#' @param classes_input List of inputs containing new classes
|
||||
#'
|
||||
#' @return a `data.table`.
|
||||
|
|
@ -11671,6 +11841,9 @@ validation_server <- function(id,
|
|||
purrr::list_flatten()
|
||||
} else if (length(to_validate) > 0) {
|
||||
out <- make_validation_alerts(to_validate)
|
||||
} else {
|
||||
## Defaulting to an emptu output vector
|
||||
out <- character()
|
||||
}
|
||||
valid_ui$x <- tagList(out)
|
||||
}
|
||||
|
|
@ -11894,7 +12067,7 @@ validation_lib <- function(name = NULL) {
|
|||
"mcar" = function(x, y) {
|
||||
### Placeholder for missingness validation
|
||||
list(
|
||||
string = i18n$t("There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}."),
|
||||
string = i18n$t("There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."),
|
||||
summary.fun = mcar_validate,
|
||||
summary.fun.args = list(
|
||||
data = x,
|
||||
|
|
@ -12923,6 +13096,7 @@ server <- function(input, output, session) {
|
|||
shiny::updateActionButton(inputId = "modal_browse", disabled = TRUE)
|
||||
shiny::updateActionButton(inputId = "modal_visual_overview", disabled = TRUE)
|
||||
shiny::updateActionButton(inputId = "act_eval", disabled = TRUE)
|
||||
# shiny::updateActionButton(inputId = "act_miss", disabled = TRUE)
|
||||
|
||||
# bslib::nav_hide(id = "main_panel",
|
||||
# target = "nav_visuals")
|
||||
|
|
@ -12931,6 +13105,7 @@ server <- function(input, output, session) {
|
|||
shiny::updateActionButton(inputId = "modal_browse", disabled = FALSE)
|
||||
shiny::updateActionButton(inputId = "modal_visual_overview", disabled = FALSE)
|
||||
shiny::updateActionButton(inputId = "act_eval", disabled = FALSE)
|
||||
# shiny::updateActionButton(inputId = "act_miss", disabled = FALSE)
|
||||
|
||||
# bslib::nav_show(id = "main_panel",
|
||||
# target = "nav_visuals")
|
||||
|
|
@ -12946,7 +13121,6 @@ server <- function(input, output, session) {
|
|||
})
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Data modification section
|
||||
|
|
@ -13185,12 +13359,13 @@ server <- function(input, output, session) {
|
|||
# mcar_validate(data=rv$missings()[["_data"]],outcome = input$missings_var)
|
||||
if (!is.null(rv$missings())) {
|
||||
req(rv$missings())
|
||||
req(input$missings_var)
|
||||
# req(input$missings_var)
|
||||
# browser()
|
||||
rv_validations$mcar <- make_validation(
|
||||
ls = validation_lib("mcar"),
|
||||
list(
|
||||
x = rv$missings()[["_data"]],
|
||||
y = input$missings_var
|
||||
y = attr(rv$missings(), "strat_var")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
@ -13523,8 +13698,6 @@ server <- function(input, output, session) {
|
|||
# })
|
||||
|
||||
|
||||
|
||||
|
||||
shiny::observeEvent(
|
||||
list(
|
||||
input$act_eval
|
||||
|
|
@ -13536,7 +13709,6 @@ server <- function(input, output, session) {
|
|||
shiny::req(rv$list$data)
|
||||
|
||||
|
||||
|
||||
parameters <- list(
|
||||
by.var = input$strat_var,
|
||||
add.p = input$add_p == "yes",
|
||||
|
|
@ -13617,25 +13789,16 @@ server <- function(input, output, session) {
|
|||
cutoff = shiny::reactive(input$cor_cutoff)
|
||||
)
|
||||
|
||||
shiny::observe(
|
||||
output$missings_var <- shiny::renderUI({
|
||||
columnSelectInput(
|
||||
inputId = "missings_var",
|
||||
label = i18n$t("Select variable to stratify analysis"),
|
||||
data = shiny::reactive({
|
||||
shiny::req(rv$data_filtered)
|
||||
rv$data_filtered[apply(rv$data_filtered, 2, anyNA)]
|
||||
})()
|
||||
)
|
||||
})
|
||||
)
|
||||
## Missingness evaluation
|
||||
|
||||
|
||||
rv$missings <- data_missings_server(
|
||||
id = "missingness",
|
||||
data = shiny::reactive(rv$data_filtered),
|
||||
variable = shiny::reactive(input$missings_var)
|
||||
data = shiny::reactive(rv$data_filtered)
|
||||
)
|
||||
|
||||
|
||||
|
||||
# shiny::observe({
|
||||
# req(rv$missings())
|
||||
# browser()
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -150,10 +150,7 @@
|
|||
"Settings","Indstillinger"
|
||||
"The following error occured on determining correlations:","Følgende fejl opstod i forbindelse med korrelationsanalysen:"
|
||||
"We encountered the following error creating your report:","Følgende fejl opstod, da rapporten blev dannet:"
|
||||
"No variable chosen for analysis","Ingen variabel er valgt til analysen"
|
||||
"No missing observations","Ingen manglende observationer"
|
||||
"Missing vs non-missing observations in the variable **'{variabler()}'**","Manglende vs ikke-manglende observationer i variablen **'{variabler()}'**"
|
||||
"There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}.","Der er en betydelig korrelation blandt {n_nonmcar} variabler sammenlignet efter manglende observationer i {outcome}."
|
||||
"There is a total of {p_miss} % missing observations.","Der er i alt {p_miss} % manglende observationer."
|
||||
"Median:","Median:"
|
||||
"Restore original data","Gendan originale data"
|
||||
|
|
@ -246,11 +243,9 @@
|
|||
"Data characteristics table","Oversigtstabel"
|
||||
"The dataset without text variables","Datasættet uden variabler formateret som tekst"
|
||||
"Creating the table. Hold on for a moment..","Opretter tabellen. Vent et øjeblik.."
|
||||
"Select variable to stratify analysis","Vælg variabler til at stratificere analysen"
|
||||
"Generating the report. Hold on for a moment..","Opretter rapporten. Vent et øjeblik.."
|
||||
"We encountered the following error showing missingness:","Under analysen af manglende observationer opstod følgende fejl:"
|
||||
"We encountered the following error browsing your data:","I forsøget på at vise en dataoversigt opstod følgende fejl:"
|
||||
"To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random.","Vælg svarvariablen, for at få hjælp til at vurdere om manglende observationer manglende tilfældigt eller ej (kun variabler med manglende data kan vælges). Hvis der er statistisk signifikant forskel mellem nogle af de øvrige variabler i forhold til manglende data i den valgte variable kan det være et udtryk for at data ikke mangler tilfældigt."
|
||||
"Choose a name for the column to be created or modified, then enter an expression before clicking on the button below to create the variable, or cancel to exit without saving anything.","Vælg et navn til den nye variabel, skriv din formel og tryk så på knappen for at gemme variablen, eller annuler for at lukke uden at gemme."
|
||||
"Please fill in web address and API token, then press 'Connect'.","Udfyld serveradresse og API-nøgle, og tryk så 'Fobind'."
|
||||
"Other","Other"
|
||||
|
|
@ -299,3 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -103,9 +103,7 @@
|
|||
"You can choose between these file types:","You can choose between these file types:"
|
||||
"You can import {file_extensions_text} files","You can import {file_extensions_text} files"
|
||||
"First five rows are shown below:","First five rows are shown below:"
|
||||
"No variable chosen for analysis","No variable chosen for analysis"
|
||||
"No missing observations","No missing observations"
|
||||
"Missing vs non-missing observations in the variable **'{variabler()}'**","Missing vs non-missing observations in the variable **'{variabler()}'**"
|
||||
"Grouped by {get_label(data,ter)}","Grouped by {get_label(data,ter)}"
|
||||
"Import data from REDCap","Import data from REDCap"
|
||||
"REDCap server","REDCap server"
|
||||
|
|
@ -207,7 +205,6 @@
|
|||
"Correlation cut-off","Correlation cut-off"
|
||||
"Set the cut-off for considered 'highly correlated'.","Set the cut-off for considered 'highly correlated'."
|
||||
"Missings","Missings"
|
||||
"To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random.","To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random."
|
||||
"Visuals","Visuals"
|
||||
"Analysis validation","Analysis validation"
|
||||
"Report","Report"
|
||||
|
|
@ -230,7 +227,6 @@
|
|||
"You removed {p_out} % of observations.","You removed {p_out} % of observations."
|
||||
"You removed {p_out} % of variables.","You removed {p_out} % of variables."
|
||||
"There is a total of {p_miss} % missing observations.","There is a total of {p_miss} % missing observations."
|
||||
"There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}.","There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}."
|
||||
"Data includes {n_pairs} pairs of highly correlated variables.","Data includes {n_pairs} pairs of highly correlated variables."
|
||||
"Class","Class"
|
||||
"Observations","Observations"
|
||||
|
|
@ -267,7 +263,6 @@
|
|||
"The dataset without text variables","The dataset without text variables"
|
||||
"The data includes {n_col} variables. Please limit to 100.","The data includes {n_col} variables. Please limit to 100."
|
||||
"Creating the table. Hold on for a moment..","Creating the table. Hold on for a moment.."
|
||||
"Select variable to stratify analysis","Select variable to stratify analysis"
|
||||
"Generating the report. Hold on for a moment..","Generating the report. Hold on for a moment.."
|
||||
"We encountered the following error creating your report:","We encountered the following error creating your report:"
|
||||
"There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data.","There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data."
|
||||
|
|
@ -299,3 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -103,9 +103,7 @@
|
|||
"You can choose between these file types:","You can choose between these file types:"
|
||||
"You can import {file_extensions_text} files","You can import {file_extensions_text} files"
|
||||
"First five rows are shown below:","First five rows are shown below:"
|
||||
"No variable chosen for analysis","No variable chosen for analysis"
|
||||
"No missing observations","No missing observations"
|
||||
"Missing vs non-missing observations in the variable **'{variabler()}'**","Missing vs non-missing observations in the variable **'{variabler()}'**"
|
||||
"Grouped by {get_label(data,ter)}","Grouped by {get_label(data,ter)}"
|
||||
"Import data from REDCap","Import data from REDCap"
|
||||
"REDCap server","REDCap server"
|
||||
|
|
@ -207,7 +205,6 @@
|
|||
"Correlation cut-off","Correlation cut-off"
|
||||
"Set the cut-off for considered 'highly correlated'.","Set the cut-off for considered 'highly correlated'."
|
||||
"Missings","Missings"
|
||||
"To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random.","To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random."
|
||||
"Visuals","Visuals"
|
||||
"Analysis validation","Analysis validation"
|
||||
"Report","Report"
|
||||
|
|
@ -230,7 +227,6 @@
|
|||
"You removed {p_out} % of observations.","You removed {p_out} % of observations."
|
||||
"You removed {p_out} % of variables.","You removed {p_out} % of variables."
|
||||
"There is a total of {p_miss} % missing observations.","There is a total of {p_miss} % missing observations."
|
||||
"There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}.","There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}."
|
||||
"Data includes {n_pairs} pairs of highly correlated variables.","Data includes {n_pairs} pairs of highly correlated variables."
|
||||
"Class","Class"
|
||||
"Observations","Observations"
|
||||
|
|
@ -267,7 +263,6 @@
|
|||
"The dataset without text variables","The dataset without text variables"
|
||||
"The data includes {n_col} variables. Please limit to 100.","The data includes {n_col} variables. Please limit to 100."
|
||||
"Creating the table. Hold on for a moment..","Creating the table. Hold on for a moment.."
|
||||
"Select variable to stratify analysis","Select variable to stratify analysis"
|
||||
"Generating the report. Hold on for a moment..","Generating the report. Hold on for a moment.."
|
||||
"We encountered the following error creating your report:","We encountered the following error creating your report:"
|
||||
"There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data.","There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data."
|
||||
|
|
@ -299,3 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -150,10 +150,7 @@
|
|||
"Settings","Settings"
|
||||
"The following error occured on determining correlations:","The following error occured on determining correlations:"
|
||||
"We encountered the following error creating your report:","We encountered the following error creating your report:"
|
||||
"No variable chosen for analysis","No variable chosen for analysis"
|
||||
"No missing observations","No missing observations"
|
||||
"Missing vs non-missing observations in the variable **'{variabler()}'**","Missing vs non-missing observations in the variable **'{variabler()}'**"
|
||||
"There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}.","There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}."
|
||||
"There is a total of {p_miss} % missing observations.","There is a total of {p_miss} % missing observations."
|
||||
"Median:","Median:"
|
||||
"Restore original data","Restore original data"
|
||||
|
|
@ -246,11 +243,9 @@
|
|||
"Data characteristics table","Data characteristics table"
|
||||
"The dataset without text variables","The dataset without text variables"
|
||||
"Creating the table. Hold on for a moment..","Creating the table. Hold on for a moment.."
|
||||
"Select variable to stratify analysis","Select variable to stratify analysis"
|
||||
"Generating the report. Hold on for a moment..","Generating the report. Hold on for a moment.."
|
||||
"We encountered the following error showing missingness:","We encountered the following error showing missingness:"
|
||||
"We encountered the following error browsing your data:","We encountered the following error browsing your data:"
|
||||
"To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random.","To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random."
|
||||
"Choose a name for the column to be created or modified, then enter an expression before clicking on the button below to create the variable, or cancel to exit without saving anything.","Choose a name for the column to be created or modified, then enter an expression before clicking on the button below to create the variable, or cancel to exit without saving anything."
|
||||
"Other","Other"
|
||||
"Hour of the day","Hour of the day"
|
||||
|
|
@ -299,3 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -91,3 +91,12 @@ $(document).on('focus', '.smart-dropdown .selectize-control input', function() {
|
|||
}
|
||||
});
|
||||
|
||||
// window.addEventListener('beforeunload', function (e) {
|
||||
// // Cancel the event
|
||||
// e.preventDefault();
|
||||
// // Chrome requires returnValue to be set
|
||||
// e.returnValue = '';
|
||||
// // Some browsers display this message, others show a generic one
|
||||
// return 'Are you sure you want to leave? Any unsaved changes will be lost.';
|
||||
// });
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
########
|
||||
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpejDCIE/filec7541d50b50.R
|
||||
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpT9sPX5/file6c8068b55910.R
|
||||
########
|
||||
|
||||
i18n_path <- system.file("translations", package = "FreesearchR")
|
||||
|
|
@ -49,6 +49,7 @@ library(shiny.i18n)
|
|||
## Translation init
|
||||
i18n <- shiny.i18n::Translator$new(translation_csvs_path = i18n_path)
|
||||
|
||||
# i18n <- shiny.i18n::Translator$new(translation_csvs_path = here::here("inst/translations/"))
|
||||
i18n$set_translation_language("en")
|
||||
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ i18n$set_translation_language("en")
|
|||
#### Current file: /Users/au301842/FreesearchR/R//app_version.R
|
||||
########
|
||||
|
||||
app_version <- function()'25.12.2'
|
||||
app_version <- function()'25.12.3'
|
||||
|
||||
|
||||
########
|
||||
|
|
@ -856,8 +857,18 @@ make_choices_with_infos <- function(data) {
|
|||
#' @importFrom shiny selectizeInput
|
||||
#' @export
|
||||
#'
|
||||
columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
||||
col_subset = NULL, placeholder = "", onInitialize, none_label="No variable selected",maxItems=NULL) {
|
||||
columnSelectInput <- function(
|
||||
inputId,
|
||||
label,
|
||||
data,
|
||||
selected = "",
|
||||
...,
|
||||
col_subset = NULL,
|
||||
placeholder = "",
|
||||
onInitialize,
|
||||
none_label = "No variable selected",
|
||||
maxItems = NULL
|
||||
) {
|
||||
datar <- if (is.reactive(data)) data else reactive(data)
|
||||
col_subsetr <- if (is.reactive(col_subset)) col_subset else reactive(col_subset)
|
||||
|
||||
|
|
@ -877,8 +888,8 @@ columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
|||
)
|
||||
}, col = names(datar()))
|
||||
|
||||
if (!"none" %in% names(datar())){
|
||||
labels <- c("none"=list(sprintf('\n {\n \"name\": \"none\",\n \"label\": \"%s\",\n \"dataclass\": \"\",\n \"datatype\": \"\"\n }',none_label)),labels)
|
||||
if (!"none" %in% names(datar())) {
|
||||
labels <- c("none" = list(sprintf('\n {\n \"name\": \"none\",\n \"label\": \"%s\",\n \"dataclass\": \"\",\n \"datatype\": \"\"\n }', none_label)), labels)
|
||||
choices <- setNames(names(labels), labels)
|
||||
choices <- choices[match(if (length(col_subsetr()) == 0 || isTRUE(col_subsetr() == "")) names(datar()) else col_subsetr(), choices)]
|
||||
} else {
|
||||
|
|
@ -922,7 +933,7 @@ columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
|||
'</div>';
|
||||
}
|
||||
}")),
|
||||
if (!is.null(maxItems)) list(maxItems=maxItems)
|
||||
if (!is.null(maxItems)) list(maxItems = maxItems)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
@ -943,31 +954,31 @@ columnSelectInput <- function(inputId, label, data, selected = "", ...,
|
|||
#'
|
||||
#' @examples
|
||||
#' if (shiny::interactive()) {
|
||||
#' shinyApp(
|
||||
#' ui = fluidPage(
|
||||
#' shiny::uiOutput("select"),
|
||||
#' tableOutput("data")
|
||||
#' ),
|
||||
#' server = function(input, output) {
|
||||
#' output$select <- shiny::renderUI({
|
||||
#' vectorSelectInput(
|
||||
#' inputId = "variable", label = "Variable:",
|
||||
#' data = c(
|
||||
#' "Cylinders" = "cyl",
|
||||
#' "Transmission" = "am",
|
||||
#' "Gears" = "gear"
|
||||
#' shinyApp(
|
||||
#' ui = fluidPage(
|
||||
#' shiny::uiOutput("select"),
|
||||
#' tableOutput("data")
|
||||
#' ),
|
||||
#' server = function(input, output) {
|
||||
#' output$select <- shiny::renderUI({
|
||||
#' vectorSelectInput(
|
||||
#' inputId = "variable", label = "Variable:",
|
||||
#' data = c(
|
||||
#' "Cylinders" = "cyl",
|
||||
#' "Transmission" = "am",
|
||||
#' "Gears" = "gear"
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#' })
|
||||
#' })
|
||||
#'
|
||||
#' output$data <- renderTable(
|
||||
#' {
|
||||
#' mtcars[, c("mpg", input$variable), drop = FALSE]
|
||||
#' },
|
||||
#' rownames = TRUE
|
||||
#' )
|
||||
#' }
|
||||
#' )
|
||||
#' output$data <- renderTable(
|
||||
#' {
|
||||
#' mtcars[, c("mpg", input$variable), drop = FALSE]
|
||||
#' },
|
||||
#' rownames = TRUE
|
||||
#' )
|
||||
#' }
|
||||
#' )
|
||||
#' }
|
||||
vectorSelectInput <- function(inputId,
|
||||
label,
|
||||
|
|
@ -1022,8 +1033,6 @@ vectorSelectInput <- function(inputId,
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
########
|
||||
#### Current file: /Users/au301842/FreesearchR/R//cut_var.R
|
||||
########
|
||||
|
|
@ -2662,7 +2671,7 @@ create_plot <- function(data, type, pri, sec, ter = NULL, ...) {
|
|||
out
|
||||
}
|
||||
|
||||
#' Print label, and if missing print variable name
|
||||
#' Print label, and if missing print variable name for plots
|
||||
#'
|
||||
#' @param data vector or data frame
|
||||
#' @param var variable name. Optional.
|
||||
|
|
@ -4429,7 +4438,7 @@ data_types <- function() {
|
|||
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
|
||||
########
|
||||
|
||||
hosted_version <- function()'v25.12.2-251203'
|
||||
hosted_version <- function()'v25.12.3-251211'
|
||||
|
||||
|
||||
########
|
||||
|
|
@ -5521,18 +5530,46 @@ launch_FreesearchR <- function(...){
|
|||
#' Data correlations evaluation module
|
||||
#'
|
||||
#' @param id Module id
|
||||
#' @param ... additional UI elements to show before the table overview
|
||||
#'
|
||||
#' @name data-missings
|
||||
#' @returns Shiny ui module
|
||||
#' @export
|
||||
data_missings_ui <- function(id) {
|
||||
data_missings_ui <- function(id, ...) {
|
||||
ns <- shiny::NS(id)
|
||||
|
||||
shiny::tagList(
|
||||
gt::gt_output(outputId = ns("missings_table"))
|
||||
list(
|
||||
bslib::layout_sidebar(
|
||||
sidebar = bslib::sidebar(
|
||||
bslib::accordion(
|
||||
id = ns("acc_mis"),
|
||||
open = "acc_chars",
|
||||
multiple = FALSE,
|
||||
bslib::accordion_panel(
|
||||
value = "acc_pan_mis",
|
||||
title = "Settings",
|
||||
icon = bsicons::bs_icon("x-circle"),
|
||||
shiny::uiOutput(ns("missings_method")),
|
||||
shiny::uiOutput(ns("missings_var")),
|
||||
shiny::helpText(i18n$t("Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.")),
|
||||
shiny::br(),
|
||||
shiny::actionButton(
|
||||
inputId = ns("act_miss"),
|
||||
label = i18n$t("Evaluate"),
|
||||
width = "100%",
|
||||
icon = shiny::icon("calculator"),
|
||||
disabled = FALSE
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
...,
|
||||
gt::gt_output(outputId = ns("missings_table"))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
## This should really just be rebuild to only contain a function
|
||||
|
||||
#'
|
||||
#' @param data data
|
||||
|
|
@ -5543,108 +5580,200 @@ data_missings_ui <- function(id) {
|
|||
#' @export
|
||||
data_missings_server <- function(id,
|
||||
data,
|
||||
variable,
|
||||
max_level=20,
|
||||
max_level = 20,
|
||||
...) {
|
||||
shiny::moduleServer(
|
||||
id = id,
|
||||
module = function(input, output, session) {
|
||||
# ns <- session$ns
|
||||
ns <- session$ns
|
||||
|
||||
datar <- if (is.reactive(data)) data else reactive(data)
|
||||
variabler <- if (is.reactive(variable)) variable else reactive(variable)
|
||||
|
||||
rv <- shiny::reactiveValues(
|
||||
data = NULL,
|
||||
table = NULL
|
||||
)
|
||||
|
||||
rv$data <- shiny::reactive({
|
||||
df_tbl <- datar()
|
||||
by_var <- variabler()
|
||||
## Notes
|
||||
##
|
||||
## Code export is still missing
|
||||
## Direct table export would be nice
|
||||
|
||||
tryCatch(
|
||||
{
|
||||
out <- compare_missings(df_tbl,by_var,max_level = max_level)
|
||||
},
|
||||
error = function(err) {
|
||||
showNotification(paste0("Error: ", err), type = "err")
|
||||
}
|
||||
)
|
||||
shiny::observe(
|
||||
output$missings_method <- shiny::renderUI({
|
||||
shiny::req(data())
|
||||
vectorSelectInput(
|
||||
inputId = ns("missings_method"),
|
||||
label = i18n$t("Analysis method for missingness overview"),
|
||||
choices = setNames(
|
||||
c(
|
||||
"predictors",
|
||||
"outcome"
|
||||
),
|
||||
c(
|
||||
i18n$t("Overview of missings across variables"),
|
||||
i18n$t("Overview of difference in variables by missing status in outcome")
|
||||
)
|
||||
)
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
out
|
||||
})
|
||||
|
||||
output$missings_table <- gt::render_gt({
|
||||
shiny::req(datar)
|
||||
shiny::req(variabler)
|
||||
|
||||
if (is.null(variabler()) || variabler() == "" || !variabler() %in% names(datar())) {
|
||||
tbl <- rv$data()
|
||||
if (anyNA(datar())){
|
||||
title <- i18n$t("No variable chosen for analysis")
|
||||
shiny::observe({
|
||||
output$missings_var <- shiny::renderUI({
|
||||
shiny::req(datar())
|
||||
shiny::req(input$missings_method)
|
||||
# browser()
|
||||
if (input$missings_method == "predictors") {
|
||||
label <- i18n$t("Select a variable for grouped overview")
|
||||
df <- data_type_filter(data(), type = c("categorical", "dichotomous"))
|
||||
col_subset <- c("none", names(df))
|
||||
} else {
|
||||
title <- i18n$t("No missing observations")
|
||||
label <- i18n$t("Select outcome variable for overview")
|
||||
df <- datar()[apply(datar(), 2, anyNA)]
|
||||
col_subset <- names(df)
|
||||
}
|
||||
} else {
|
||||
tbl <- rv$data()|>
|
||||
gtsummary::bold_p()
|
||||
title <- glue::glue(i18n$t("Missing vs non-missing observations in the variable **'{variabler()}'**"))
|
||||
}
|
||||
|
||||
out <- tbl |>
|
||||
gtsummary::as_gt() |>
|
||||
gt::tab_header(title = gt::md(title))
|
||||
|
||||
rv$table <- out
|
||||
|
||||
out
|
||||
columnSelectInput(
|
||||
inputId = ns("missings_var"),
|
||||
label = label,
|
||||
data = df,
|
||||
col_subset = col_subset,
|
||||
none_label = i18n$t("No variable")
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
return(reactive(rv$table))
|
||||
|
||||
shiny::observeEvent(
|
||||
list(input$act_miss),
|
||||
{
|
||||
shiny::req(datar())
|
||||
shiny::req(input$missings_var)
|
||||
# browser()
|
||||
df_tbl <- datar()
|
||||
by_var <- input$missings_var
|
||||
|
||||
parameters <- list(
|
||||
by_var = by_var,
|
||||
max_level = max_level,
|
||||
type = input$missings_method
|
||||
)
|
||||
|
||||
tryCatch(
|
||||
{
|
||||
shiny::withProgress(message = i18n$t("Calculating. Hold tight for a moment.."), {
|
||||
out <- do.call(
|
||||
compare_missings,
|
||||
modifyList(parameters, list(data = df_tbl))
|
||||
)
|
||||
})
|
||||
},
|
||||
error = function(err) {
|
||||
showNotification(paste0("Error: ", err), type = "err")
|
||||
}
|
||||
)
|
||||
|
||||
if (is.null(input$missings_var) || input$missings_var == "" || !input$missings_var %in% names(datar()) || input$missings_var == "none") {
|
||||
# if (is.null(variabler()) || variabler() == "" || !variabler() %in% names(data()) || variabler() == "none") {
|
||||
# tbl <- rv$data()
|
||||
if (anyNA(datar())) {
|
||||
if (input$missings_method == "predictors") {
|
||||
title <- i18n$t("Overview of missing observations")
|
||||
} else {
|
||||
title <- i18n$t("No outcome measure chosen")
|
||||
}
|
||||
} else {
|
||||
title <- i18n$t("No missing observations")
|
||||
}
|
||||
} else {
|
||||
## Due to reactivity, the table updates too quickly. this mitigates that issue..
|
||||
|
||||
|
||||
if (input$missings_var == "predictors") {
|
||||
title <- glue::glue(i18n$t("Missings across variables by the variable **'{input$missings_var}'**"))
|
||||
} else {
|
||||
title <- glue::glue(i18n$t("Missing vs non-missing observations in the variable **'{input$missings_var}'**"))
|
||||
}
|
||||
}
|
||||
|
||||
attr(out, "tbl_title") <- title
|
||||
|
||||
rv$data <- shiny::reactive(out)
|
||||
}
|
||||
)
|
||||
|
||||
shiny::observeEvent(
|
||||
list(
|
||||
# input$act_miss
|
||||
rv$data
|
||||
),
|
||||
{
|
||||
output$missings_table <- gt::render_gt({
|
||||
shiny::req(rv$data)
|
||||
# shiny::req(input$missings_var)
|
||||
# browser()
|
||||
if ("p.value" %in% names(rv$data()[["table_body"]])) {
|
||||
tbl <- rv$data() |>
|
||||
gtsummary::bold_p()
|
||||
} else {
|
||||
tbl <- rv$data()
|
||||
}
|
||||
|
||||
|
||||
out <- tbl |>
|
||||
gtsummary::as_gt() |>
|
||||
gt::tab_header(title = gt::md(attr(tbl, "tbl_title")))
|
||||
|
||||
attr(out, "strat_var") <- input$missings_var
|
||||
|
||||
rv$table <- out
|
||||
|
||||
out
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
return(shiny::reactive(rv$table))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
missing_demo_app <- function() {
|
||||
ui <- shiny::fluidPage(
|
||||
shiny::actionButton(
|
||||
inputId = "modal_missings",
|
||||
label = "Browse data",
|
||||
width = "100%",
|
||||
disabled = FALSE
|
||||
),
|
||||
shiny::selectInput(
|
||||
inputId = "missings_var",
|
||||
label = "Select variable to stratify analysis", choices = c("cyl", "vs")
|
||||
),
|
||||
data_missings_ui("data")
|
||||
ui <- do.call(
|
||||
bslib::page,
|
||||
c(
|
||||
list(
|
||||
title = i18n$t("Missings"),
|
||||
icon = bsicons::bs_icon("x-circle")
|
||||
),
|
||||
data_missings_ui(id = "data")
|
||||
)
|
||||
)
|
||||
server <- function(input, output, session) {
|
||||
data_demo <- mtcars
|
||||
data_demo[sample(1:32, 10), "cyl"] <- NA
|
||||
data_demo[sample(1:32, 8), "vs"] <- NA
|
||||
|
||||
data_missings_server(id = "data", data = data_demo, variable = shiny::reactive(input$missings_var))
|
||||
data_missings_server(id = "data", data = data_demo)
|
||||
|
||||
visual_summary_server(id = "visual", data = data_demo)
|
||||
# visual_summary_server(id = "visual", data = data_demo)
|
||||
|
||||
observeEvent(input$modal_missings, {
|
||||
tryCatch(
|
||||
{
|
||||
modal_visual_summary(id = "visual")
|
||||
},
|
||||
error = function(err) {
|
||||
showNotification(paste0("We encountered the following error browsing your data: ", err), type = "err")
|
||||
}
|
||||
)
|
||||
})
|
||||
# observeEvent(input$modal_missings, {
|
||||
# tryCatch(
|
||||
# {
|
||||
# modal_visual_summary(id = "visual")
|
||||
# },
|
||||
# error = function(err) {
|
||||
# showNotification(paste0("We encountered the following error browsing your data: ", err), type = "err")
|
||||
# }
|
||||
# )
|
||||
# })
|
||||
}
|
||||
shiny::shinyApp(ui, server)
|
||||
}
|
||||
|
||||
missing_demo_app()
|
||||
# missing_demo_app()
|
||||
|
||||
#' Pairwise comparison of missings across covariables
|
||||
#'
|
||||
|
|
@ -5654,28 +5783,80 @@ missing_demo_app()
|
|||
#' @returns gtsummary list object
|
||||
#' @export
|
||||
#'
|
||||
compare_missings <- function(data,by_var,max_level=20){
|
||||
compare_missings <- function(
|
||||
data,
|
||||
by_var,
|
||||
max_level = 20,
|
||||
type = c("predictors", "outcome")
|
||||
) {
|
||||
type <- match.arg(type)
|
||||
|
||||
if (!is.null(by_var) && by_var != "" && by_var %in% names(data)) {
|
||||
data <- data |>
|
||||
lapply(\(.x){
|
||||
# browser()
|
||||
if (is.factor(.x)){
|
||||
cut_var(.x,breaks=20,type="top")
|
||||
if (is.factor(.x)) {
|
||||
cut_var(.x, breaks = 20, type = "top")
|
||||
} else {
|
||||
.x
|
||||
}
|
||||
}) |> dplyr::bind_cols()
|
||||
}) |>
|
||||
dplyr::bind_cols()
|
||||
|
||||
data[[by_var]] <- ifelse(is.na(data[[by_var]]), "Missing", "Non-missing")
|
||||
if (type == "predictors") {
|
||||
data <- missings_logic_across(data, exclude = by_var)
|
||||
} else {
|
||||
data[[by_var]] <- ifelse(is.na(data[[by_var]]), "Missing", "Non-missing")
|
||||
}
|
||||
|
||||
out <- gtsummary::tbl_summary(data, by = by_var) |>
|
||||
gtsummary::add_p()
|
||||
} else {
|
||||
if (type == "predictors") {
|
||||
data <- missings_logic_across(data)
|
||||
}
|
||||
|
||||
out <- gtsummary::tbl_summary(data)
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
#' Converting all variables to logicals by missing status
|
||||
#'
|
||||
#' @param data data
|
||||
#' @param exclude character vector of variable names to be excluded
|
||||
#'
|
||||
#' @returns data frame
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' mtcars |> missings_logic_across("cyl")
|
||||
#' ## gtsummary::trial |>
|
||||
#' ## missings_logic_across() |>
|
||||
#' ## gtsummary::tbl_summary()
|
||||
missings_logic_across <- function(data, exclude = NULL) {
|
||||
# This function includes a approach way to preserve variable labels
|
||||
names(data) |>
|
||||
lapply(\(.x){
|
||||
# browser()
|
||||
# Saving original labels
|
||||
lab <- REDCapCAST::get_attr(data[[.x]], attr = "label")
|
||||
if (!.x %in% exclude) {
|
||||
out <- is.na(data[[.x]])
|
||||
} else {
|
||||
out <- data[[.x]]
|
||||
}
|
||||
if (!is.na(lab)) {
|
||||
# Restoring original labels, if not NA
|
||||
REDCapCAST::set_attr(data = out, label = lab, attr = "label", overwrite = TRUE)
|
||||
} else {
|
||||
out
|
||||
}
|
||||
}) |>
|
||||
dplyr::bind_cols(.name_repair = "unique_quiet") |>
|
||||
setNames(names(data))
|
||||
}
|
||||
|
||||
|
||||
########
|
||||
#### Current file: /Users/au301842/FreesearchR/R//plot_bar.R
|
||||
|
|
@ -10156,26 +10337,15 @@ ui_elements <- function(selection) {
|
|||
data_correlations_ui(id = "correlations", height = 600)
|
||||
)
|
||||
),
|
||||
bslib::nav_panel(
|
||||
title = i18n$t("Missings"),
|
||||
icon = bsicons::bs_icon("x-circle"),
|
||||
bslib::layout_sidebar(
|
||||
sidebar = bslib::sidebar(
|
||||
bslib::accordion(
|
||||
id = "acc_mis",
|
||||
open = "acc_chars",
|
||||
multiple = FALSE,
|
||||
bslib::accordion_panel(
|
||||
value = "acc_pan_mis",
|
||||
title = "Settings",
|
||||
icon = bsicons::bs_icon("x-circle"),
|
||||
shiny::uiOutput("missings_var"),
|
||||
shiny::helpText(i18n$t("To consider if data is missing by random, choose the outcome/dependent variable (only variables with any missings are available). If there is a significant difference across other variables depending on missing observations, it may not be missing at random."))
|
||||
)
|
||||
)
|
||||
do.call(
|
||||
bslib::nav_panel,
|
||||
c(
|
||||
list(
|
||||
title = i18n$t("Missings"),
|
||||
icon = bsicons::bs_icon("x-circle")
|
||||
),
|
||||
validation_ui("validation_mcar"),
|
||||
data_missings_ui(id = "missingness")
|
||||
data_missings_ui(id = "missingness",
|
||||
validation_ui("validation_mcar"))
|
||||
)
|
||||
)
|
||||
),
|
||||
|
|
@ -11438,7 +11608,7 @@ convert_to <- function(data,
|
|||
|
||||
#' Get variable(s) to convert
|
||||
#'
|
||||
#' @param vars Output of [summary_vars()]
|
||||
#' @param vars variables, output from summary_vars() function
|
||||
#' @param classes_input List of inputs containing new classes
|
||||
#'
|
||||
#' @return a `data.table`.
|
||||
|
|
@ -11671,6 +11841,9 @@ validation_server <- function(id,
|
|||
purrr::list_flatten()
|
||||
} else if (length(to_validate) > 0) {
|
||||
out <- make_validation_alerts(to_validate)
|
||||
} else {
|
||||
## Defaulting to an emptu output vector
|
||||
out <- character()
|
||||
}
|
||||
valid_ui$x <- tagList(out)
|
||||
}
|
||||
|
|
@ -11894,7 +12067,7 @@ validation_lib <- function(name = NULL) {
|
|||
"mcar" = function(x, y) {
|
||||
### Placeholder for missingness validation
|
||||
list(
|
||||
string = i18n$t("There is a significant correlation between {n_nonmcar} variables and missing observations in the outcome variable {outcome}."),
|
||||
string = i18n$t("There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."),
|
||||
summary.fun = mcar_validate,
|
||||
summary.fun.args = list(
|
||||
data = x,
|
||||
|
|
@ -12923,6 +13096,7 @@ server <- function(input, output, session) {
|
|||
shiny::updateActionButton(inputId = "modal_browse", disabled = TRUE)
|
||||
shiny::updateActionButton(inputId = "modal_visual_overview", disabled = TRUE)
|
||||
shiny::updateActionButton(inputId = "act_eval", disabled = TRUE)
|
||||
# shiny::updateActionButton(inputId = "act_miss", disabled = TRUE)
|
||||
|
||||
# bslib::nav_hide(id = "main_panel",
|
||||
# target = "nav_visuals")
|
||||
|
|
@ -12931,6 +13105,7 @@ server <- function(input, output, session) {
|
|||
shiny::updateActionButton(inputId = "modal_browse", disabled = FALSE)
|
||||
shiny::updateActionButton(inputId = "modal_visual_overview", disabled = FALSE)
|
||||
shiny::updateActionButton(inputId = "act_eval", disabled = FALSE)
|
||||
# shiny::updateActionButton(inputId = "act_miss", disabled = FALSE)
|
||||
|
||||
# bslib::nav_show(id = "main_panel",
|
||||
# target = "nav_visuals")
|
||||
|
|
@ -12946,7 +13121,6 @@ server <- function(input, output, session) {
|
|||
})
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Data modification section
|
||||
|
|
@ -13185,12 +13359,13 @@ server <- function(input, output, session) {
|
|||
# mcar_validate(data=rv$missings()[["_data"]],outcome = input$missings_var)
|
||||
if (!is.null(rv$missings())) {
|
||||
req(rv$missings())
|
||||
req(input$missings_var)
|
||||
# req(input$missings_var)
|
||||
# browser()
|
||||
rv_validations$mcar <- make_validation(
|
||||
ls = validation_lib("mcar"),
|
||||
list(
|
||||
x = rv$missings()[["_data"]],
|
||||
y = input$missings_var
|
||||
y = attr(rv$missings(), "strat_var")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
@ -13523,8 +13698,6 @@ server <- function(input, output, session) {
|
|||
# })
|
||||
|
||||
|
||||
|
||||
|
||||
shiny::observeEvent(
|
||||
list(
|
||||
input$act_eval
|
||||
|
|
@ -13536,7 +13709,6 @@ server <- function(input, output, session) {
|
|||
shiny::req(rv$list$data)
|
||||
|
||||
|
||||
|
||||
parameters <- list(
|
||||
by.var = input$strat_var,
|
||||
add.p = input$add_p == "yes",
|
||||
|
|
@ -13617,25 +13789,16 @@ server <- function(input, output, session) {
|
|||
cutoff = shiny::reactive(input$cor_cutoff)
|
||||
)
|
||||
|
||||
shiny::observe(
|
||||
output$missings_var <- shiny::renderUI({
|
||||
columnSelectInput(
|
||||
inputId = "missings_var",
|
||||
label = i18n$t("Select variable to stratify analysis"),
|
||||
data = shiny::reactive({
|
||||
shiny::req(rv$data_filtered)
|
||||
rv$data_filtered[apply(rv$data_filtered, 2, anyNA)]
|
||||
})()
|
||||
)
|
||||
})
|
||||
)
|
||||
## Missingness evaluation
|
||||
|
||||
|
||||
rv$missings <- data_missings_server(
|
||||
id = "missingness",
|
||||
data = shiny::reactive(rv$data_filtered),
|
||||
variable = shiny::reactive(input$missings_var)
|
||||
data = shiny::reactive(rv$data_filtered)
|
||||
)
|
||||
|
||||
|
||||
|
||||
# shiny::observe({
|
||||
# req(rv$missings())
|
||||
# browser()
|
||||
|
|
|
|||
|
|
@ -91,3 +91,12 @@ $(document).on('focus', '.smart-dropdown .selectize-control input', function() {
|
|||
}
|
||||
});
|
||||
|
||||
// window.addEventListener('beforeunload', function (e) {
|
||||
// // Cancel the event
|
||||
// e.preventDefault();
|
||||
// // Chrome requires returnValue to be set
|
||||
// e.returnValue = '';
|
||||
// // Some browsers display this message, others show a generic one
|
||||
// return 'Are you sure you want to leave? Any unsaved changes will be lost.';
|
||||
// });
|
||||
|
||||
|
|
|
|||
|
|
@ -91,3 +91,12 @@ $(document).on('focus', '.smart-dropdown .selectize-control input', function() {
|
|||
}
|
||||
});
|
||||
|
||||
// window.addEventListener('beforeunload', function (e) {
|
||||
// // Cancel the event
|
||||
// e.preventDefault();
|
||||
// // Chrome requires returnValue to be set
|
||||
// e.returnValue = '';
|
||||
// // Some browsers display this message, others show a generic one
|
||||
// return 'Are you sure you want to leave? Any unsaved changes will be lost.';
|
||||
// });
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@
|
|||
"Settings","Indstillinger"
|
||||
"The following error occured on determining correlations:","Følgende fejl opstod i forbindelse med korrelationsanalysen:"
|
||||
"We encountered the following error creating your report:","Følgende fejl opstod, da rapporten blev dannet:"
|
||||
"No variable chosen for analysis","Ingen variabel er valgt til analysen"
|
||||
"No missing observations","Ingen manglende observationer"
|
||||
"There is a total of {p_miss} % missing observations.","Der er i alt {p_miss} % manglende observationer."
|
||||
"Median:","Median:"
|
||||
|
|
@ -244,7 +243,6 @@
|
|||
"Data characteristics table","Oversigtstabel"
|
||||
"The dataset without text variables","Datasættet uden variabler formateret som tekst"
|
||||
"Creating the table. Hold on for a moment..","Opretter tabellen. Vent et øjeblik.."
|
||||
"Select variable to stratify analysis","Vælg variabler til at stratificere analysen"
|
||||
"Generating the report. Hold on for a moment..","Opretter rapporten. Vent et øjeblik.."
|
||||
"We encountered the following error showing missingness:","Under analysen af manglende observationer opstod følgende fejl:"
|
||||
"We encountered the following error browsing your data:","I forsøget på at vise en dataoversigt opstod følgende fejl:"
|
||||
|
|
@ -296,11 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Select missings analysis to apply","Select missings analysis to apply"
|
||||
"Variables","Variables"
|
||||
"By outcome","By outcome"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -103,7 +103,6 @@
|
|||
"You can choose between these file types:","You can choose between these file types:"
|
||||
"You can import {file_extensions_text} files","You can import {file_extensions_text} files"
|
||||
"First five rows are shown below:","First five rows are shown below:"
|
||||
"No variable chosen for analysis","No variable chosen for analysis"
|
||||
"No missing observations","No missing observations"
|
||||
"Grouped by {get_label(data,ter)}","Grouped by {get_label(data,ter)}"
|
||||
"Import data from REDCap","Import data from REDCap"
|
||||
|
|
@ -264,7 +263,6 @@
|
|||
"The dataset without text variables","The dataset without text variables"
|
||||
"The data includes {n_col} variables. Please limit to 100.","The data includes {n_col} variables. Please limit to 100."
|
||||
"Creating the table. Hold on for a moment..","Creating the table. Hold on for a moment.."
|
||||
"Select variable to stratify analysis","Select variable to stratify analysis"
|
||||
"Generating the report. Hold on for a moment..","Generating the report. Hold on for a moment.."
|
||||
"We encountered the following error creating your report:","We encountered the following error creating your report:"
|
||||
"There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data.","There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data."
|
||||
|
|
@ -296,11 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Select missings analysis to apply","Select missings analysis to apply"
|
||||
"Variables","Variables"
|
||||
"By outcome","By outcome"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -103,7 +103,6 @@
|
|||
"You can choose between these file types:","You can choose between these file types:"
|
||||
"You can import {file_extensions_text} files","You can import {file_extensions_text} files"
|
||||
"First five rows are shown below:","First five rows are shown below:"
|
||||
"No variable chosen for analysis","No variable chosen for analysis"
|
||||
"No missing observations","No missing observations"
|
||||
"Grouped by {get_label(data,ter)}","Grouped by {get_label(data,ter)}"
|
||||
"Import data from REDCap","Import data from REDCap"
|
||||
|
|
@ -264,7 +263,6 @@
|
|||
"The dataset without text variables","The dataset without text variables"
|
||||
"The data includes {n_col} variables. Please limit to 100.","The data includes {n_col} variables. Please limit to 100."
|
||||
"Creating the table. Hold on for a moment..","Creating the table. Hold on for a moment.."
|
||||
"Select variable to stratify analysis","Select variable to stratify analysis"
|
||||
"Generating the report. Hold on for a moment..","Generating the report. Hold on for a moment.."
|
||||
"We encountered the following error creating your report:","We encountered the following error creating your report:"
|
||||
"There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data.","There are more advanced options to modify factor/categorical variables as well as create new factor from an existing variable or new variables with R code. At the bottom you can restore the original data."
|
||||
|
|
@ -296,11 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Select missings analysis to apply","Select missings analysis to apply"
|
||||
"Variables","Variables"
|
||||
"By outcome","By outcome"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
|
|
@ -150,7 +150,6 @@
|
|||
"Settings","Settings"
|
||||
"The following error occured on determining correlations:","The following error occured on determining correlations:"
|
||||
"We encountered the following error creating your report:","We encountered the following error creating your report:"
|
||||
"No variable chosen for analysis","No variable chosen for analysis"
|
||||
"No missing observations","No missing observations"
|
||||
"There is a total of {p_miss} % missing observations.","There is a total of {p_miss} % missing observations."
|
||||
"Median:","Median:"
|
||||
|
|
@ -244,7 +243,6 @@
|
|||
"Data characteristics table","Data characteristics table"
|
||||
"The dataset without text variables","The dataset without text variables"
|
||||
"Creating the table. Hold on for a moment..","Creating the table. Hold on for a moment.."
|
||||
"Select variable to stratify analysis","Select variable to stratify analysis"
|
||||
"Generating the report. Hold on for a moment..","Generating the report. Hold on for a moment.."
|
||||
"We encountered the following error showing missingness:","We encountered the following error showing missingness:"
|
||||
"We encountered the following error browsing your data:","We encountered the following error browsing your data:"
|
||||
|
|
@ -296,11 +294,15 @@
|
|||
"Words","Words"
|
||||
"Shorten to first letters","Shorten to first letters"
|
||||
"Shorten to first words","Shorten to first words"
|
||||
"Select missings analysis to apply","Select missings analysis to apply"
|
||||
"Variables","Variables"
|
||||
"By outcome","By outcome"
|
||||
"Missings across variables by the variable **'{input$missings_var}'**","Missings across variables by the variable **'{input$missings_var}'**"
|
||||
"Missing vs non-missing observations in the variable **'{input$missings_var}'**","Missing vs non-missing observations in the variable **'{input$missings_var}'**"
|
||||
"Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random.","Evaluate missingness by either comparing missing values across variables (optionally grouped by af categorical or dichotomous variable) or compare variables grouped by the missing status (missing or not) of an outcome variable. If there is a significant difference i the missingness, this may cause a bias in you data and should be considered carefully interpreting the data and analyses as data may not be missing at random."
|
||||
"Calculating. Hold tight for a moment..","Calculating. Hold tight for a moment.."
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nnonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
"Overview of missing observations","Overview of missing observations"
|
||||
"Analysis method for missingness overview","Analysis method for missingness overview"
|
||||
"Overview of missings across variables","Overview of missings across variables"
|
||||
"Overview of difference in variables by missing status in outcome","Overview of difference in variables by missing status in outcome"
|
||||
"Select a variable for grouped overview","Select a variable for grouped overview"
|
||||
"Select outcome variable for overview","Select outcome variable for overview"
|
||||
"No outcome measure chosen","No outcome measure chosen"
|
||||
"There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}.","There is a significant difference in data missingness in {n_nonmcar} {ifelse(n_nonmcar==1,'variable','variables')} grouped by the selected outcome/grouping variable {outcome}."
|
||||
|
|
|
|||
|
46
renv.lock
46
renv.lock
|
|
@ -9154,6 +9154,52 @@
|
|||
"Maintainer": "Davis Vaughan <davis@posit.co>",
|
||||
"Repository": "CRAN"
|
||||
},
|
||||
"viridis": {
|
||||
"Package": "viridis",
|
||||
"Version": "0.6.5",
|
||||
"Source": "Repository",
|
||||
"Type": "Package",
|
||||
"Title": "Colorblind-Friendly Color Maps for R",
|
||||
"Date": "2024-01-28",
|
||||
"Authors@R": "c( person(\"Simon\", \"Garnier\", email = \"garnier@njit.edu\", role = c(\"aut\", \"cre\")), person(\"Noam\", \"Ross\", email = \"noam.ross@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Bob\", \"Rudis\", email = \"bob@rud.is\", role = c(\"ctb\", \"cph\")), person(\"Marco\", \"Sciaini\", email = \"sciaini.marco@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Antônio Pedro\", \"Camargo\", role = c(\"ctb\", \"cph\")), person(\"Cédric\", \"Scherer\", email = \"scherer@izw-berlin.de\", role = c(\"ctb\", \"cph\")) )",
|
||||
"Maintainer": "Simon Garnier <garnier@njit.edu>",
|
||||
"Description": "Color maps designed to improve graph readability for readers with common forms of color blindness and/or color vision deficiency. The color maps are also perceptually-uniform, both in regular form and also when converted to black-and-white for printing. This package also contains 'ggplot2' bindings for discrete and continuous color and fill scales. A lean version of the package called 'viridisLite' that does not include the 'ggplot2' bindings can be found at <https://cran.r-project.org/package=viridisLite>.",
|
||||
"License": "MIT + file LICENSE",
|
||||
"Encoding": "UTF-8",
|
||||
"Depends": [
|
||||
"R (>= 2.10)",
|
||||
"viridisLite (>= 0.4.0)"
|
||||
],
|
||||
"Imports": [
|
||||
"ggplot2 (>= 1.0.1)",
|
||||
"gridExtra"
|
||||
],
|
||||
"Suggests": [
|
||||
"hexbin (>= 1.27.0)",
|
||||
"scales",
|
||||
"MASS",
|
||||
"knitr",
|
||||
"dichromat",
|
||||
"colorspace",
|
||||
"httr",
|
||||
"mapproj",
|
||||
"vdiffr",
|
||||
"svglite (>= 1.2.0)",
|
||||
"testthat",
|
||||
"covr",
|
||||
"rmarkdown",
|
||||
"maps",
|
||||
"terra"
|
||||
],
|
||||
"LazyData": "true",
|
||||
"VignetteBuilder": "knitr",
|
||||
"URL": "https://sjmgarnier.github.io/viridis/, https://github.com/sjmgarnier/viridis/",
|
||||
"BugReports": "https://github.com/sjmgarnier/viridis/issues",
|
||||
"RoxygenNote": "7.3.1",
|
||||
"NeedsCompilation": "no",
|
||||
"Author": "Simon Garnier [aut, cre], Noam Ross [ctb, cph], Bob Rudis [ctb, cph], Marco Sciaini [ctb, cph], Antônio Pedro Camargo [ctb, cph], Cédric Scherer [ctb, cph]",
|
||||
"Repository": "CRAN"
|
||||
},
|
||||
"viridisLite": {
|
||||
"Package": "viridisLite",
|
||||
"Version": "0.4.2",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue