mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 18:09:39 +02:00
Compare commits
No commits in common. "013fc19d04423a4d351728a0281e5f0b84558f25" and "7fde4bde46c2498291208124c41b0bca1189531c" have entirely different histories.
013fc19d04
...
7fde4bde46
47 changed files with 773 additions and 2323 deletions
23
CITATION.cff
23
CITATION.cff
|
@ -9,7 +9,7 @@ type: software
|
||||||
license: AGPL-3.0-or-later
|
license: AGPL-3.0-or-later
|
||||||
title: 'FreesearchR: A free and open-source browser based data analysis tool for researchers
|
title: 'FreesearchR: A free and open-source browser based data analysis tool for researchers
|
||||||
with publication ready output'
|
with publication ready output'
|
||||||
version: 25.8.3
|
version: 25.8.2
|
||||||
doi: 10.5281/zenodo.14527429
|
doi: 10.5281/zenodo.14527429
|
||||||
identifiers:
|
identifiers:
|
||||||
- type: url
|
- type: url
|
||||||
|
@ -1030,27 +1030,6 @@ references:
|
||||||
email: rpruim@calvin.edu
|
email: rpruim@calvin.edu
|
||||||
year: '2025'
|
year: '2025'
|
||||||
doi: 10.32614/CRAN.package.NHANES
|
doi: 10.32614/CRAN.package.NHANES
|
||||||
- type: software
|
|
||||||
title: shiny.i18n
|
|
||||||
abstract: 'shiny.i18n: Shiny Applications Internationalization'
|
|
||||||
notes: Imports
|
|
||||||
url: https://appsilon.github.io/shiny.i18n/
|
|
||||||
repository: https://CRAN.R-project.org/package=shiny.i18n
|
|
||||||
authors:
|
|
||||||
- family-names: Nowicki
|
|
||||||
given-names: Jakub
|
|
||||||
email: opensource+kuba@appsilon.com
|
|
||||||
- family-names: Krzemiński
|
|
||||||
given-names: Dominik
|
|
||||||
email: raymon92@gmail.com
|
|
||||||
- family-names: Igras
|
|
||||||
given-names: Krystian
|
|
||||||
email: krystian8207@gmail.com
|
|
||||||
- family-names: Sobolewski
|
|
||||||
given-names: Jakub
|
|
||||||
email: jakub.sobolewski@appsilon.com
|
|
||||||
year: '2025'
|
|
||||||
doi: 10.32614/CRAN.package.shiny.i18n
|
|
||||||
- type: software
|
- type: software
|
||||||
title: styler
|
title: styler
|
||||||
abstract: 'styler: Non-Invasive Pretty Printing of R Code'
|
abstract: 'styler: Non-Invasive Pretty Printing of R Code'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Package: FreesearchR
|
Package: FreesearchR
|
||||||
Title: A free and open-source browser based data analysis tool for researchers with publication ready output
|
Title: A free and open-source browser based data analysis tool for researchers with publication ready output
|
||||||
Version: 25.8.3
|
Version: 25.8.2
|
||||||
Authors@R: c(
|
Authors@R: c(
|
||||||
person("Andreas Gammelgaard", "Damsbo",email="agdamsbo@clin.au.dk", role = c("aut", "cre"),
|
person("Andreas Gammelgaard", "Damsbo",email="agdamsbo@clin.au.dk", role = c("aut", "cre"),
|
||||||
comment = c(ORCID = "0000-0002-7559-1154")),
|
comment = c(ORCID = "0000-0002-7559-1154")),
|
||||||
|
@ -66,8 +66,7 @@ Imports:
|
||||||
shinyjs,
|
shinyjs,
|
||||||
emmeans,
|
emmeans,
|
||||||
readxl,
|
readxl,
|
||||||
NHANES,
|
NHANES
|
||||||
shiny.i18n
|
|
||||||
Suggests:
|
Suggests:
|
||||||
styler,
|
styler,
|
||||||
devtools,
|
devtools,
|
||||||
|
|
|
@ -78,13 +78,10 @@ export(line_break)
|
||||||
export(list_allowed_operations)
|
export(list_allowed_operations)
|
||||||
export(m_redcap_readServer)
|
export(m_redcap_readServer)
|
||||||
export(m_redcap_readUI)
|
export(m_redcap_readUI)
|
||||||
export(make_validation)
|
|
||||||
export(make_validation_alerts)
|
|
||||||
export(merge_expression)
|
export(merge_expression)
|
||||||
export(merge_long)
|
export(merge_long)
|
||||||
export(missing_fraction)
|
export(missing_fraction)
|
||||||
export(missings_apex_plot)
|
export(missings_apex_plot)
|
||||||
export(missings_validate)
|
|
||||||
export(modal_create_column)
|
export(modal_create_column)
|
||||||
export(modal_cut_variable)
|
export(modal_cut_variable)
|
||||||
export(modal_update_factor)
|
export(modal_update_factor)
|
||||||
|
@ -133,8 +130,6 @@ export(update_factor_server)
|
||||||
export(update_factor_ui)
|
export(update_factor_ui)
|
||||||
export(update_variables_server)
|
export(update_variables_server)
|
||||||
export(update_variables_ui)
|
export(update_variables_ui)
|
||||||
export(validation_server)
|
|
||||||
export(validation_ui)
|
|
||||||
export(vectorSelectInput)
|
export(vectorSelectInput)
|
||||||
export(vertical_stacked_bars)
|
export(vertical_stacked_bars)
|
||||||
export(visual_summary)
|
export(visual_summary)
|
||||||
|
|
8
NEWS.md
8
NEWS.md
|
@ -1,11 +1,3 @@
|
||||||
# FreesearchR 25.8.3 - DEV
|
|
||||||
|
|
||||||
*NEW* Language has been revised to make the app more accessible and easier to understand.
|
|
||||||
|
|
||||||
*NEW* Initial and very rudimentary translation for Danish and Swahili is introduced. Other languages can be added as well.
|
|
||||||
|
|
||||||
*NEW* Alerts as to guide on select important steps and aspects are introduced. This is expected to expand.
|
|
||||||
|
|
||||||
# FreesearchR 25.8.2
|
# FreesearchR 25.8.2
|
||||||
|
|
||||||
- *NEW* Including the [NHANES](https://cran.r-project.org/web/packages/NHANES/refman/NHANES.html#NHANES) dataset for experimentation.
|
- *NEW* Including the [NHANES](https://cran.r-project.org/web/packages/NHANES/refman/NHANES.html#NHANES) dataset for experimentation.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
app_version <- function()'25.8.3'
|
app_version <- function()'25.8.2'
|
||||||
|
|
|
@ -63,7 +63,7 @@ create_column_ui <- function(id) {
|
||||||
width = 6,
|
width = 6,
|
||||||
textInput(
|
textInput(
|
||||||
inputId = ns("new_column"),
|
inputId = ns("new_column"),
|
||||||
label = i18n$t("New column name:"),
|
label = i18n("New column name:"),
|
||||||
value = "new_column1",
|
value = "new_column1",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
)
|
)
|
||||||
|
@ -72,7 +72,7 @@ create_column_ui <- function(id) {
|
||||||
width = 6,
|
width = 6,
|
||||||
shinyWidgets::virtualSelectInput(
|
shinyWidgets::virtualSelectInput(
|
||||||
inputId = ns("group_by"),
|
inputId = ns("group_by"),
|
||||||
label = i18n$t("Group calculation by:"),
|
label = i18n("Group calculation by:"),
|
||||||
choices = NULL,
|
choices = NULL,
|
||||||
multiple = TRUE,
|
multiple = TRUE,
|
||||||
disableSelectAll = TRUE,
|
disableSelectAll = TRUE,
|
||||||
|
@ -83,7 +83,7 @@ create_column_ui <- function(id) {
|
||||||
),
|
),
|
||||||
shiny::textAreaInput(
|
shiny::textAreaInput(
|
||||||
inputId = ns("expression"),
|
inputId = ns("expression"),
|
||||||
label = i18n$t("Enter an expression to define new column:"),
|
label = i18n("Enter an expression to define new column:"),
|
||||||
value = "",
|
value = "",
|
||||||
width = "100%",
|
width = "100%",
|
||||||
rows = 6
|
rows = 6
|
||||||
|
@ -91,7 +91,7 @@ create_column_ui <- function(id) {
|
||||||
tags$i(
|
tags$i(
|
||||||
class = "d-block",
|
class = "d-block",
|
||||||
phosphoricons::ph("info"),
|
phosphoricons::ph("info"),
|
||||||
i18n$t("Click on a column name to add it to the expression:")
|
datamods::i18n("Click on a column name to add it to the expression:")
|
||||||
),
|
),
|
||||||
uiOutput(outputId = ns("columns")),
|
uiOutput(outputId = ns("columns")),
|
||||||
uiOutput(outputId = ns("feedback")),
|
uiOutput(outputId = ns("feedback")),
|
||||||
|
@ -105,7 +105,7 @@ create_column_ui <- function(id) {
|
||||||
actionButton(
|
actionButton(
|
||||||
inputId = ns("compute"),
|
inputId = ns("compute"),
|
||||||
label = tagList(
|
label = tagList(
|
||||||
phosphoricons::ph("gear"), i18n$t("Create column")
|
phosphoricons::ph("gear"), i18n("Create column")
|
||||||
),
|
),
|
||||||
class = "btn-outline-primary",
|
class = "btn-outline-primary",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
|
@ -140,9 +140,9 @@ create_column_server <- function(id,
|
||||||
info_alert <- shinyWidgets::alert(
|
info_alert <- shinyWidgets::alert(
|
||||||
status = "info",
|
status = "info",
|
||||||
phosphoricons::ph("question"),
|
phosphoricons::ph("question"),
|
||||||
i18n$t("Choose a name for the column to be created or modified,"),
|
datamods::i18n("Choose a name for the column to be created or modified,"),
|
||||||
i18n$t("then enter an expression before clicking on the button above to validate or on "),
|
datamods::i18n("then enter an expression before clicking on the button above to validate or on "),
|
||||||
phosphoricons::ph("trash"), i18n$t("to delete it.")
|
phosphoricons::ph("trash"), datamods::i18n("to delete it.")
|
||||||
)
|
)
|
||||||
|
|
||||||
rv <- reactiveValues(
|
rv <- reactiveValues(
|
||||||
|
@ -187,7 +187,7 @@ create_column_server <- function(id,
|
||||||
if (input$new_column == "") {
|
if (input$new_column == "") {
|
||||||
rv$feedback <- shinyWidgets::alert(
|
rv$feedback <- shinyWidgets::alert(
|
||||||
status = "warning",
|
status = "warning",
|
||||||
phosphoricons::ph("warning"), i18n$t("New column name cannot be empty")
|
phosphoricons::ph("warning"), datamods::i18n("New column name cannot be empty")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -252,7 +252,7 @@ list_allowed_operations <- function() {
|
||||||
#'
|
#'
|
||||||
#' @rdname create-column
|
#' @rdname create-column
|
||||||
modal_create_column <- function(id,
|
modal_create_column <- function(id,
|
||||||
title = i18n$t("Create a new column"),
|
title = i18n("Create a new column"),
|
||||||
easyClose = TRUE,
|
easyClose = TRUE,
|
||||||
size = "l",
|
size = "l",
|
||||||
footer = NULL) {
|
footer = NULL) {
|
||||||
|
@ -277,7 +277,7 @@ modal_create_column <- function(id,
|
||||||
#' @importFrom htmltools tagList
|
#' @importFrom htmltools tagList
|
||||||
#' @rdname create-column
|
#' @rdname create-column
|
||||||
winbox_create_column <- function(id,
|
winbox_create_column <- function(id,
|
||||||
title = i18n$t("Create a new column"),
|
title = i18n("Create a new column"),
|
||||||
options = shinyWidgets::wbOptions(),
|
options = shinyWidgets::wbOptions(),
|
||||||
controls = shinyWidgets::wbControls()) {
|
controls = shinyWidgets::wbControls()) {
|
||||||
ns <- NS(id)
|
ns <- NS(id)
|
||||||
|
@ -311,7 +311,7 @@ try_compute_column <- function(expression,
|
||||||
}
|
}
|
||||||
funs <- unlist(c(extract_calls(parsed), lapply(parsed, extract_calls)), recursive = TRUE)
|
funs <- unlist(c(extract_calls(parsed), lapply(parsed, extract_calls)), recursive = TRUE)
|
||||||
if (!are_allowed_operations(funs, allowed_operations)) {
|
if (!are_allowed_operations(funs, allowed_operations)) {
|
||||||
return(datamods:::alert_error(i18n$t("Some operations are not allowed")))
|
return(datamods:::alert_error(datamods::i18n("Some operations are not allowed")))
|
||||||
}
|
}
|
||||||
if (!isTruthy(by)) {
|
if (!isTruthy(by)) {
|
||||||
result <- try(
|
result <- try(
|
||||||
|
@ -351,7 +351,7 @@ try_compute_column <- function(expression,
|
||||||
)
|
)
|
||||||
shinyWidgets::alert(
|
shinyWidgets::alert(
|
||||||
status = "success",
|
status = "success",
|
||||||
phosphoricons::ph("check"), i18n$t("Column added!")
|
phosphoricons::ph("check"), datamods::i18n("Column added!")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ make_choices_with_infos <- function(data) {
|
||||||
# NULL
|
# NULL
|
||||||
# }
|
# }
|
||||||
description <- if (is.atomic(values)) {
|
description <- if (is.atomic(values)) {
|
||||||
paste(i18n$t("Unique values:"), data.table::uniqueN(values))
|
paste(i18n("Unique values:"), data.table::uniqueN(values))
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ cut_variable_ui <- function(id) {
|
||||||
width = 3,
|
width = 3,
|
||||||
shinyWidgets::virtualSelectInput(
|
shinyWidgets::virtualSelectInput(
|
||||||
inputId = ns("variable"),
|
inputId = ns("variable"),
|
||||||
label = i18n$t("Variable to cut:"),
|
label = datamods:::i18n("Variable to cut:"),
|
||||||
choices = NULL,
|
choices = NULL,
|
||||||
width = "100%"
|
width = "100%"
|
||||||
)
|
)
|
||||||
|
@ -221,7 +221,7 @@ cut_variable_ui <- function(id) {
|
||||||
width = 3,
|
width = 3,
|
||||||
numericInput(
|
numericInput(
|
||||||
inputId = ns("n_breaks"),
|
inputId = ns("n_breaks"),
|
||||||
label = i18n$t("Number of breaks:"),
|
label = datamods:::i18n("Number of breaks:"),
|
||||||
value = 3,
|
value = 3,
|
||||||
min = 2,
|
min = 2,
|
||||||
max = 12,
|
max = 12,
|
||||||
|
@ -232,12 +232,12 @@ cut_variable_ui <- function(id) {
|
||||||
width = 3,
|
width = 3,
|
||||||
checkboxInput(
|
checkboxInput(
|
||||||
inputId = ns("right"),
|
inputId = ns("right"),
|
||||||
label = i18n$t("Close intervals on the right"),
|
label = datamods:::i18n("Close intervals on the right"),
|
||||||
value = TRUE
|
value = TRUE
|
||||||
),
|
),
|
||||||
checkboxInput(
|
checkboxInput(
|
||||||
inputId = ns("include_lowest"),
|
inputId = ns("include_lowest"),
|
||||||
label = i18n$t("Include lowest value"),
|
label = datamods:::i18n("Include lowest value"),
|
||||||
value = TRUE
|
value = TRUE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -251,7 +251,7 @@ cut_variable_ui <- function(id) {
|
||||||
toastui::datagridOutput2(outputId = ns("count")),
|
toastui::datagridOutput2(outputId = ns("count")),
|
||||||
actionButton(
|
actionButton(
|
||||||
inputId = ns("create"),
|
inputId = ns("create"),
|
||||||
label = tagList(phosphoricons::ph("scissors"), i18n$t("Create factor variable")),
|
label = tagList(phosphoricons::ph("scissors"), datamods:::i18n("Create factor variable")),
|
||||||
class = "btn-outline-primary float-end"
|
class = "btn-outline-primary float-end"
|
||||||
),
|
),
|
||||||
tags$div(class = "clearfix")
|
tags$div(class = "clearfix")
|
||||||
|
@ -321,7 +321,7 @@ cut_variable_server <- function(id, data_r = reactive(NULL)) {
|
||||||
|
|
||||||
shinyWidgets::noUiSliderInput(
|
shinyWidgets::noUiSliderInput(
|
||||||
inputId = session$ns("fixed_brks"),
|
inputId = session$ns("fixed_brks"),
|
||||||
label = i18n$t("Fixed breaks:"),
|
label = datamods:::i18n("Fixed breaks:"),
|
||||||
min = lower,
|
min = lower,
|
||||||
max = upper,
|
max = upper,
|
||||||
value = brks,
|
value = brks,
|
||||||
|
@ -376,7 +376,7 @@ cut_variable_server <- function(id, data_r = reactive(NULL)) {
|
||||||
|
|
||||||
shinyWidgets::virtualSelectInput(
|
shinyWidgets::virtualSelectInput(
|
||||||
inputId = session$ns("method"),
|
inputId = session$ns("method"),
|
||||||
label = i18n$t("Method:"),
|
label = datamods:::i18n("Method:"),
|
||||||
choices = choices,
|
choices = choices,
|
||||||
selected = NULL,
|
selected = NULL,
|
||||||
width = "100%"
|
width = "100%"
|
||||||
|
@ -570,7 +570,7 @@ cut_variable_server <- function(id, data_r = reactive(NULL)) {
|
||||||
#'
|
#'
|
||||||
#' @rdname cut-variable
|
#' @rdname cut-variable
|
||||||
modal_cut_variable <- function(id,
|
modal_cut_variable <- function(id,
|
||||||
title = i18n$t("Convert Numeric to Factor"),
|
title = datamods:::i18n("Convert Numeric to Factor"),
|
||||||
easyClose = TRUE,
|
easyClose = TRUE,
|
||||||
size = "l",
|
size = "l",
|
||||||
footer = NULL) {
|
footer = NULL) {
|
||||||
|
|
|
@ -129,14 +129,14 @@ describe_col_char <- function(x, with_summary = TRUE) {
|
||||||
tagList(
|
tagList(
|
||||||
tags$hr(style = htmltools::css(margin = "3px 0")),
|
tags$hr(style = htmltools::css(margin = "3px 0")),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Unique:"), length(unique(x))
|
datamods:::i18n("Unique:"), length(unique(x))
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Missing:"), sum(is.na(x))
|
datamods:::i18n("Missing:"), sum(is.na(x))
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
style = htmltools::css(whiteSpace = "normal", wordBreak = "break-all"),
|
style = htmltools::css(whiteSpace = "normal", wordBreak = "break-all"),
|
||||||
i18n$t("Most Common:"), gsub(
|
datamods:::i18n("Most Common:"), gsub(
|
||||||
pattern = "'",
|
pattern = "'",
|
||||||
replacement = "\u07F4",
|
replacement = "\u07F4",
|
||||||
x = names(sort(table(x), decreasing = TRUE))[1]
|
x = names(sort(table(x), decreasing = TRUE))[1]
|
||||||
|
@ -178,7 +178,7 @@ describe_col_factor <- function(x, with_summary = TRUE) {
|
||||||
names(two), ":", fmt_p(two, total)
|
names(two), ":", fmt_p(two, total)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Missing:"), fmt_p(missing, total)
|
"Missing", ":", fmt_p(missing, total)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
"\u00A0"
|
"\u00A0"
|
||||||
|
@ -201,16 +201,16 @@ describe_col_num <- function(x, with_summary = TRUE) {
|
||||||
tagList(
|
tagList(
|
||||||
tags$hr(style = htmltools::css(margin = "3px 0")),
|
tags$hr(style = htmltools::css(margin = "3px 0")),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Min:"), round(min(x, na.rm = TRUE), 2)
|
datamods:::i18n("Min:"), round(min(x, na.rm = TRUE), 2)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Mean:"), round(mean(x, na.rm = TRUE), 2)
|
datamods:::i18n("Mean:"), round(mean(x, na.rm = TRUE), 2)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Max:"), round(max(x, na.rm = TRUE), 2)
|
datamods:::i18n("Max:"), round(max(x, na.rm = TRUE), 2)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Missing:"), sum(is.na(x))
|
datamods:::i18n("Missing:"), sum(is.na(x))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -231,13 +231,13 @@ describe_col_date <- function(x, with_summary = TRUE) {
|
||||||
tagList(
|
tagList(
|
||||||
tags$hr(style = htmltools::css(margin = "3px 0")),
|
tags$hr(style = htmltools::css(margin = "3px 0")),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Min:"), min(x, na.rm = TRUE)
|
datamods:::i18n("Min:"), min(x, na.rm = TRUE)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Max:"), max(x, na.rm = TRUE)
|
datamods:::i18n("Max:"), max(x, na.rm = TRUE)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Missing:"), sum(is.na(x))
|
datamods:::i18n("Missing:"), sum(is.na(x))
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
"\u00A0"
|
"\u00A0"
|
||||||
|
@ -260,13 +260,13 @@ describe_col_datetime <- function(x, with_summary = TRUE) {
|
||||||
tagList(
|
tagList(
|
||||||
tags$hr(style = htmltools::css(margin = "3px 0")),
|
tags$hr(style = htmltools::css(margin = "3px 0")),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Min:"), min(x, na.rm = TRUE)
|
datamods:::i18n("Min:"), min(x, na.rm = TRUE)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Max:"), max(x, na.rm = TRUE)
|
datamods:::i18n("Max:"), max(x, na.rm = TRUE)
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Missing:"), sum(is.na(x))
|
datamods:::i18n("Missing:"), sum(is.na(x))
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
"\u00A0"
|
"\u00A0"
|
||||||
|
@ -290,10 +290,10 @@ describe_col_other <- function(x, with_summary = TRUE) {
|
||||||
tagList(
|
tagList(
|
||||||
tags$hr(style = htmltools::css(margin = "3px 0")),
|
tags$hr(style = htmltools::css(margin = "3px 0")),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Unique:"), length(unique(x))
|
datamods:::i18n("Unique:"), length(unique(x))
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
i18n$t("Missing:"), sum(is.na(x))
|
datamods:::i18n("Missing:"), sum(is.na(x))
|
||||||
),
|
),
|
||||||
tags$div(
|
tags$div(
|
||||||
"\u00A0"
|
"\u00A0"
|
||||||
|
|
19
R/helpers.R
19
R/helpers.R
|
@ -361,17 +361,16 @@ data_description <- function(data, data_text = "Data") {
|
||||||
n <- nrow(data)
|
n <- nrow(data)
|
||||||
n_var <- ncol(data)
|
n_var <- ncol(data)
|
||||||
n_complete <- sum(complete.cases(data))
|
n_complete <- sum(complete.cases(data))
|
||||||
p_complete <- signif(100 * n_complete / n, 3)
|
p_complete <- n_complete / n
|
||||||
|
|
||||||
glue::glue(i18n$t("{data_text} has {n} observations and {n_var} variables, with {n_complete} ({p_complete} %) complete cases."))
|
sprintf(
|
||||||
# sprintf(
|
"%s has %s observations and %s variables, with %s (%s%%) complete cases.",
|
||||||
# "%s has %s observations and %s variables, with %s (%s%%) complete cases.",
|
data_text,
|
||||||
# data_text,
|
n,
|
||||||
# n,
|
n_var,
|
||||||
# n_var,
|
n_complete,
|
||||||
# n_complete,
|
signif(100 * p_complete, 3)
|
||||||
# p_complete
|
)
|
||||||
# )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
hosted_version <- function()'v25.8.3-250910'
|
hosted_version <- function()'v25.8.2-250827'
|
||||||
|
|
|
@ -24,7 +24,7 @@ import_file_ui <- function(id,
|
||||||
|
|
||||||
if (isTRUE(title)) {
|
if (isTRUE(title)) {
|
||||||
title <- shiny::tags$h4(
|
title <- shiny::tags$h4(
|
||||||
"Import a file",
|
datamods:::i18n("Import a file"),
|
||||||
class = "datamods-title"
|
class = "datamods-title"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ import_file_ui <- function(id,
|
||||||
width = 6,
|
width = 6,
|
||||||
shinyWidgets::numericInputIcon(
|
shinyWidgets::numericInputIcon(
|
||||||
inputId = ns("skip_rows"),
|
inputId = ns("skip_rows"),
|
||||||
label = i18n$t("Rows to skip before reading data:"),
|
label = datamods:::i18n("Rows to skip before reading data:"),
|
||||||
value = 0,
|
value = 0,
|
||||||
min = 0,
|
min = 0,
|
||||||
icon = list("n ="),
|
icon = list("n ="),
|
||||||
|
@ -45,20 +45,20 @@ import_file_ui <- function(id,
|
||||||
shiny::tagAppendChild(
|
shiny::tagAppendChild(
|
||||||
shinyWidgets::textInputIcon(
|
shinyWidgets::textInputIcon(
|
||||||
inputId = ns("na_label"),
|
inputId = ns("na_label"),
|
||||||
label = i18n$t("Missing values character(s):"),
|
label = datamods:::i18n("Missing values character(s):"),
|
||||||
value = "NA,,'',na",
|
value = "NA,,'',na",
|
||||||
icon = list("NA"),
|
icon = list("NA"),
|
||||||
size = "sm",
|
size = "sm",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
),
|
),
|
||||||
shiny::helpText(phosphoricons::ph("info"), i18n$t("if several use a comma (',') to separate them"))
|
shiny::helpText(phosphoricons::ph("info"), datamods:::i18n("if several use a comma (',') to separate them"))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
shinyWidgets::textInputIcon(
|
shinyWidgets::textInputIcon(
|
||||||
inputId = ns("dec"),
|
inputId = ns("dec"),
|
||||||
label = i18n$t("Decimal separator:"),
|
label = datamods:::i18n("Decimal separator:"),
|
||||||
value = ".",
|
value = ".",
|
||||||
icon = list("0.00"),
|
icon = list("0.00"),
|
||||||
size = "sm",
|
size = "sm",
|
||||||
|
@ -66,7 +66,7 @@ import_file_ui <- function(id,
|
||||||
),
|
),
|
||||||
selectInputIcon(
|
selectInputIcon(
|
||||||
inputId = ns("encoding"),
|
inputId = ns("encoding"),
|
||||||
label = i18n$t("Encoding:"),
|
label = datamods:::i18n("Encoding:"),
|
||||||
choices = c(
|
choices = c(
|
||||||
"UTF-8" = "UTF-8",
|
"UTF-8" = "UTF-8",
|
||||||
"Latin1" = "latin1"
|
"Latin1" = "latin1"
|
||||||
|
@ -81,9 +81,9 @@ import_file_ui <- function(id,
|
||||||
file_ui <- shiny::tagAppendAttributes(
|
file_ui <- shiny::tagAppendAttributes(
|
||||||
shiny::fileInput(
|
shiny::fileInput(
|
||||||
inputId = ns("file"),
|
inputId = ns("file"),
|
||||||
label = i18n$t("Upload a file:"),
|
label = datamods:::i18n("Upload a file:"),
|
||||||
buttonLabel = i18n$t("Browse..."),
|
buttonLabel = datamods:::i18n("Browse..."),
|
||||||
placeholder = "No file selected; maximum file size is 5 mb",
|
placeholder = datamods:::i18n("No file selected; maximum file size is 5 mb"),
|
||||||
accept = file_extensions,
|
accept = file_extensions,
|
||||||
width = "100%",
|
width = "100%",
|
||||||
## A solution to allow multiple file upload is being considered
|
## A solution to allow multiple file upload is being considered
|
||||||
|
@ -130,7 +130,7 @@ import_file_ui <- function(id,
|
||||||
id = ns("sheet-container"),
|
id = ns("sheet-container"),
|
||||||
shinyWidgets::pickerInput(
|
shinyWidgets::pickerInput(
|
||||||
inputId = ns("sheet"),
|
inputId = ns("sheet"),
|
||||||
label = i18n$t("Select sheet to import:"),
|
label = datamods:::i18n("Select sheet to import:"),
|
||||||
choices = NULL,
|
choices = NULL,
|
||||||
width = "100%",
|
width = "100%",
|
||||||
multiple = TRUE
|
multiple = TRUE
|
||||||
|
@ -141,11 +141,8 @@ import_file_ui <- function(id,
|
||||||
shinyWidgets::alert(
|
shinyWidgets::alert(
|
||||||
id = ns("import-result"),
|
id = ns("import-result"),
|
||||||
status = "info",
|
status = "info",
|
||||||
shiny::tags$b(i18n$t("No file selected.")),
|
shiny::tags$b(datamods:::i18n("No file selected:")),
|
||||||
# shiny::textOutput(ns("trans_format_text")),
|
sprintf(datamods:::i18n("You can import %s files"), paste(file_extensions, collapse = ", ")),
|
||||||
# This is the easiest solution, though not gramatically perfect
|
|
||||||
i18n$t("You can choose between these file types:"), paste(file_extensions,collapse=', '),
|
|
||||||
# sprintf("You can import %s files", paste(file_extensions, collapse = ", ")),
|
|
||||||
dismissible = TRUE
|
dismissible = TRUE
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -209,11 +206,6 @@ import_file_server <- function(id,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
# ## Translations
|
|
||||||
# shiny::observe({
|
|
||||||
# output$trans_format_text <- shiny::renderText(glue::glue(i18n$t("You can import {file_extensions_text} files")))
|
|
||||||
# })
|
|
||||||
|
|
||||||
shiny::observeEvent(input$file, {
|
shiny::observeEvent(input$file, {
|
||||||
## Several steps are taken to ensure no errors on changed input file
|
## Several steps are taken to ensure no errors on changed input file
|
||||||
temporary_rv$sheets <- 1
|
temporary_rv$sheets <- 1
|
||||||
|
@ -278,7 +270,7 @@ import_file_server <- function(id,
|
||||||
|
|
||||||
if (inherits(imported, "try-error") || NROW(imported) < 1) {
|
if (inherits(imported, "try-error") || NROW(imported) < 1) {
|
||||||
datamods:::toggle_widget(inputId = "confirm", enable = FALSE)
|
datamods:::toggle_widget(inputId = "confirm", enable = FALSE)
|
||||||
datamods:::insert_error(mssg = i18n$t(attr(imported, "condition")$message))
|
datamods:::insert_error(mssg = datamods:::i18n(attr(imported, "condition")$message))
|
||||||
temporary_rv$status <- "error"
|
temporary_rv$status <- "error"
|
||||||
temporary_rv$data <- NULL
|
temporary_rv$data <- NULL
|
||||||
temporary_rv$name <- NULL
|
temporary_rv$name <- NULL
|
||||||
|
@ -293,7 +285,7 @@ import_file_server <- function(id,
|
||||||
imported,
|
imported,
|
||||||
trigger_return = trigger_return,
|
trigger_return = trigger_return,
|
||||||
btn_show_data = btn_show_data,
|
btn_show_data = btn_show_data,
|
||||||
extra = if (isTRUE(input$preview_data)) i18n$t("First five rows are shown below:")
|
extra = if (isTRUE(input$preview_data)) datamods:::i18n("First five rows are shown below:")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
temporary_rv$status <- "success"
|
temporary_rv$status <- "success"
|
||||||
|
@ -308,7 +300,7 @@ import_file_server <- function(id,
|
||||||
observeEvent(input$see_data, {
|
observeEvent(input$see_data, {
|
||||||
tryCatch(
|
tryCatch(
|
||||||
{
|
{
|
||||||
datamods:::show_data(default_parsing(temporary_rv$data), title = i18n$t("Imported data"), type = show_data_in)
|
datamods:::show_data(default_parsing(temporary_rv$data), title = datamods:::i18n("Imported data"), type = show_data_in)
|
||||||
},
|
},
|
||||||
# warning = function(warn) {
|
# warning = function(warn) {
|
||||||
# showNotification(warn, type = "warning")
|
# showNotification(warn, type = "warning")
|
||||||
|
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
|
@ -1,8 +0,0 @@
|
||||||
language_choices <- function() {
|
|
||||||
c(
|
|
||||||
"🇬🇧 English" = "en",
|
|
||||||
"🇹🇿 Kiswahili" = "sw",
|
|
||||||
"🇩🇰 Dansk" = "da"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
152
R/ui_elements.R
152
R/ui_elements.R
|
@ -17,10 +17,6 @@ ui_elements <- function(selection) {
|
||||||
# title = shiny::div(htmltools::img(src="FreesearchR-logo-white-nobg-h80.png")),
|
# title = shiny::div(htmltools::img(src="FreesearchR-logo-white-nobg-h80.png")),
|
||||||
icon = shiny::icon("house"),
|
icon = shiny::icon("house"),
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
# "The browser language is",
|
|
||||||
# textOutput("your_lang"),
|
|
||||||
# p(i18n$t("Hello")),
|
|
||||||
# shiny::uiOutput(outputId = "language_select"),
|
|
||||||
## On building the dev-version for shinyapps.io, the dev_banner() is redefined
|
## On building the dev-version for shinyapps.io, the dev_banner() is redefined
|
||||||
## Default just output "NULL"
|
## Default just output "NULL"
|
||||||
## This could probably be achieved more legantly, but this works.
|
## This could probably be achieved more legantly, but this works.
|
||||||
|
@ -28,12 +24,9 @@ ui_elements <- function(selection) {
|
||||||
shiny::column(width = 2),
|
shiny::column(width = 2),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 8,
|
width = 8,
|
||||||
shiny::uiOutput(outputId = "language_select"),
|
shiny::markdown(readLines("www/intro.md")),
|
||||||
htmlOutput("intro_text")
|
shiny::column(width = 2)
|
||||||
# shiny::includeHTML(i18n$t("www/intro.html"))
|
)
|
||||||
# shiny::markdown(readLines(i18n$t("www/intro.md")))
|
|
||||||
),
|
|
||||||
shiny::column(width = 2)
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@ -42,32 +35,28 @@ ui_elements <- function(selection) {
|
||||||
#########
|
#########
|
||||||
##############################################################################
|
##############################################################################
|
||||||
"import" = bslib::nav_panel(
|
"import" = bslib::nav_panel(
|
||||||
title = i18n$t("Get started"),
|
title = "Get started",
|
||||||
icon = shiny::icon("play"),
|
icon = shiny::icon("play"),
|
||||||
value = "nav_import",
|
value = "nav_import",
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
shiny::column(width = 2),
|
shiny::column(width = 2),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 8,
|
width = 8,
|
||||||
shiny::h4(i18n$t("Choose your data")),
|
shiny::h4("Choose your data source"),
|
||||||
# shiny::br(),
|
shiny::br(),
|
||||||
# shiny::uiOutput(outputId = "source"),
|
# shiny::uiOutput(outputId = "source"),
|
||||||
# radioGroupButtons(
|
shinyWidgets::radioGroupButtons(
|
||||||
# inputId = "source",
|
|
||||||
# selected = "file",
|
|
||||||
# choices = c("File" = "file"),
|
|
||||||
# size = "lg"
|
|
||||||
# ),
|
|
||||||
shiny::selectInput(
|
|
||||||
inputId = "source",
|
inputId = "source",
|
||||||
label="",
|
|
||||||
selected = "file",
|
selected = "file",
|
||||||
choices = "file",
|
choices = c(
|
||||||
width = "100%"
|
"File upload" = "file",
|
||||||
|
"REDCap server export" = "redcap",
|
||||||
|
"Local or sample data" = "env"
|
||||||
|
),
|
||||||
|
size = "lg"
|
||||||
),
|
),
|
||||||
# shiny::tags$script('document.querySelector("#source div").style.width = "100%"'),
|
shiny::tags$script('document.querySelector("#source div").style.width = "100%"'),
|
||||||
## Update this to change depending on run locally or hosted
|
shiny::helpText("Upload a file from your device, get data directly from REDCap or select a sample data set for testing from the app."),
|
||||||
shiny::helpText(i18n$t("Upload a file, get data directly from REDCap or use local or sample data.")),
|
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::conditionalPanel(
|
shiny::conditionalPanel(
|
||||||
|
@ -81,14 +70,13 @@ ui_elements <- function(selection) {
|
||||||
),
|
),
|
||||||
shiny::conditionalPanel(
|
shiny::conditionalPanel(
|
||||||
condition = "input.source=='redcap'",
|
condition = "input.source=='redcap'",
|
||||||
shiny::uiOutput(outputId = "redcap_warning"),
|
shinyWidgets::alert(
|
||||||
# shinyWidgets::alert(
|
id = "redcap-warning",
|
||||||
# id = "redcap-warning",
|
status = "info",
|
||||||
# status = "warning",
|
shiny::tags$h2(shiny::markdown("Careful with sensitive data")),
|
||||||
# shiny::tags$h2(i18n$t("Please be mindfull handling sensitive data")),
|
shiny::tags$p("The", shiny::tags$i(shiny::tags$b("FreesearchR")), "app only stores data for analyses, but please only use with sensitive data when running locally.", "", shiny::tags$a("Read more here", href = "https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine"), "."),
|
||||||
# shiny::HTML(i18n$t("<p>The <em><strong>FreesearchR</strong></em> app only stores data for analyses, but please only use with sensitive data when running locally. <a href='https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine'>Read more here</a></p>")),
|
dismissible = TRUE
|
||||||
# dismissible = TRUE
|
),
|
||||||
# ),
|
|
||||||
m_redcap_readUI(
|
m_redcap_readUI(
|
||||||
id = "redcap_import",
|
id = "redcap_import",
|
||||||
title = ""
|
title = ""
|
||||||
|
@ -107,18 +95,18 @@ ui_elements <- function(selection) {
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_initial_view",
|
inputId = "modal_initial_view",
|
||||||
label = i18n$t("Quick overview"),
|
label = "Quick overview",
|
||||||
width = "100%",
|
width = "100%",
|
||||||
icon = shiny::icon("binoculars"),
|
icon = shiny::icon("binoculars"),
|
||||||
disabled = FALSE
|
disabled = FALSE
|
||||||
),
|
),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::h5(i18n$t("Select variables for final import")),
|
shiny::h5("Select variables for final import"),
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
shiny::p(i18n$t("Exclude incomplete variables:")),
|
shiny::p("Exclude incomplete variables:"),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shinyWidgets::noUiSliderInput(
|
shinyWidgets::noUiSliderInput(
|
||||||
inputId = "complete_cutoff",
|
inputId = "complete_cutoff",
|
||||||
|
@ -131,12 +119,12 @@ ui_elements <- function(selection) {
|
||||||
format = shinyWidgets::wNumbFormat(decimals = 0),
|
format = shinyWidgets::wNumbFormat(decimals = 0),
|
||||||
color = datamods:::get_primary_color()
|
color = datamods:::get_primary_color()
|
||||||
),
|
),
|
||||||
shiny::helpText(i18n$t("At 0, only complete variables are included; at 100, all variables are included.")),
|
shiny::helpText("Only include variables missing less observations than the specified percentage."),
|
||||||
shiny::br()
|
shiny::br()
|
||||||
),
|
),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
shiny::p(i18n$t("Manual selection:")),
|
shiny::p("Manual selection:"),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::uiOutput(outputId = "import_var"),
|
shiny::uiOutput(outputId = "import_var"),
|
||||||
shiny::br()
|
shiny::br()
|
||||||
|
@ -147,11 +135,12 @@ ui_elements <- function(selection) {
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "act_start",
|
inputId = "act_start",
|
||||||
label = i18n$t("Let's begin!"),
|
label = "Start",
|
||||||
width = "100%",
|
width = "100%",
|
||||||
icon = shiny::icon("play"),
|
icon = shiny::icon("play"),
|
||||||
disabled = TRUE
|
disabled = TRUE
|
||||||
),
|
),
|
||||||
|
shiny::helpText('After importing, hit "Start" or navigate to the desired tab.'),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::br()
|
shiny::br()
|
||||||
),
|
),
|
||||||
|
@ -167,27 +156,28 @@ ui_elements <- function(selection) {
|
||||||
#########
|
#########
|
||||||
##############################################################################
|
##############################################################################
|
||||||
"prepare" = bslib::nav_menu(
|
"prepare" = bslib::nav_menu(
|
||||||
title = i18n$t("Prepare"),
|
title = "Prepare",
|
||||||
icon = shiny::icon("pen-to-square"),
|
icon = shiny::icon("pen-to-square"),
|
||||||
value = "nav_prepare",
|
value = "nav_prepare",
|
||||||
bslib::nav_panel(
|
bslib::nav_panel(
|
||||||
title = i18n$t("Overview and filter"),
|
title = "Overview and filter",
|
||||||
icon = shiny::icon("eye"),
|
icon = shiny::icon("eye"),
|
||||||
value = "nav_prepare_overview",
|
value = "nav_prepare_overview",
|
||||||
tags$h3(i18n$t("Overview and filtering")),
|
tags$h3("Overview and filtering"),
|
||||||
|
# validation_ui("validation_col"),
|
||||||
fluidRow(
|
fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 9,
|
width = 9,
|
||||||
shiny::uiOutput(outputId = "data_info", inline = TRUE),
|
shiny::uiOutput(outputId = "data_info", inline = TRUE),
|
||||||
shiny::tags$p(
|
shiny::tags$p(
|
||||||
i18n$t("Below you find a summary table for quick insigths, and on the right you can visualise data classes, browse data and apply different data filters.")
|
"Below is a short summary table, on the right you can click to visualise data classes or browse data and create different data filters."
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 3,
|
width = 3,
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_visual_overview",
|
inputId = "modal_visual_overview",
|
||||||
label = i18n$t("Visual overview"),
|
label = "Visual overview",
|
||||||
width = "100%",
|
width = "100%",
|
||||||
disabled = TRUE
|
disabled = TRUE
|
||||||
),
|
),
|
||||||
|
@ -195,7 +185,7 @@ ui_elements <- function(selection) {
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_browse",
|
inputId = "modal_browse",
|
||||||
label = i18n$t("Browse data"),
|
label = "Browse data",
|
||||||
width = "100%",
|
width = "100%",
|
||||||
disabled = TRUE
|
disabled = TRUE
|
||||||
),
|
),
|
||||||
|
@ -215,24 +205,21 @@ ui_elements <- function(selection) {
|
||||||
),
|
),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 3,
|
width = 3,
|
||||||
shiny::tags$h6(i18n$t("Filter data types")),
|
shiny::tags$h6("Filter data types"),
|
||||||
shiny::uiOutput(
|
shiny::uiOutput(
|
||||||
outputId = "column_filter"
|
outputId = "column_filter"
|
||||||
),
|
),
|
||||||
## This needs to run in server for translation
|
|
||||||
shiny::helpText("Read more on how ", tags$a(
|
shiny::helpText("Read more on how ", tags$a(
|
||||||
"data types",
|
"data types",
|
||||||
href = "https://agdamsbo.github.io/FreesearchR/articles/data-types.html",
|
href = "https://agdamsbo.github.io/FreesearchR/articles/data-types.html",
|
||||||
target = "_blank",
|
target = "_blank",
|
||||||
rel = "noopener noreferrer"
|
rel = "noopener noreferrer"
|
||||||
), " are defined."),
|
), " are defined."),
|
||||||
validation_ui("validation_var"),
|
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::tags$h6(i18n$t("Filter observations")),
|
shiny::tags$h6("Filter observations"),
|
||||||
shiny::tags$p(i18n$t("Apply filter on observation")),
|
shiny::tags$p("Filter on observation level"),
|
||||||
IDEAFilter::IDEAFilter_ui("data_filter"),
|
IDEAFilter::IDEAFilter_ui("data_filter"),
|
||||||
validation_ui("validation_obs"),
|
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::br()
|
shiny::br()
|
||||||
)
|
)
|
||||||
|
@ -242,24 +229,24 @@ ui_elements <- function(selection) {
|
||||||
shiny::br()
|
shiny::br()
|
||||||
),
|
),
|
||||||
bslib::nav_panel(
|
bslib::nav_panel(
|
||||||
title = i18n$t("Edit and create data"),
|
title = "Modify",
|
||||||
icon = shiny::icon("file-pen"),
|
icon = shiny::icon("file-pen"),
|
||||||
tags$h3(i18n$t("Subset, rename and convert variables")),
|
tags$h3("Subset, rename and convert variables"),
|
||||||
fluidRow(
|
fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 9,
|
width = 9,
|
||||||
shiny::tags$p(
|
shiny::tags$p(
|
||||||
i18n$t("Below, are several options for simple data manipulation like update variables by renaming, creating new labels (for nicer tables in the report) and changing variable classes (numeric, factor/categorical etc.)."),
|
shiny::markdown("Below, are several options for simple data manipulation like update variables by renaming, creating new labels (for nicer tables in the report) and changing variable classes (numeric, factor/categorical etc.)."),
|
||||||
i18n$t("There are more advanced options to modify factor/categorical variables as well as create new factor from a continous variable or new variables with R code. At the bottom you can restore the original data."),
|
shiny::markdown("There are more advanced options to modify factor/categorical variables as well as create new factor from a continous variable or new variables with *R* code. At the bottom you can restore the original data."),
|
||||||
i18n$t("Please note that data modifications are applied before any filtering.")
|
shiny::markdown("Please note that data modifications are applied before any filtering.")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
update_variables_ui("modal_variables"),
|
update_variables_ui("modal_variables"),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$h4(i18n$t("Advanced data manipulation")),
|
shiny::tags$h4("Advanced data manipulation"),
|
||||||
shiny::tags$p(i18n$t("Below options allow more advanced varaible manipulations.")),
|
shiny::tags$p("Below options allow more advanced varaible manipulations."),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
|
@ -267,11 +254,11 @@ ui_elements <- function(selection) {
|
||||||
width = 4,
|
width = 4,
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_update",
|
inputId = "modal_update",
|
||||||
label = i18n$t("Reorder factor levels"),
|
label = "Reorder factor levels",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::helpText(i18n$t("Reorder the levels of factor/categorical variables.")),
|
shiny::helpText("Reorder the levels of factor/categorical variables."),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br()
|
shiny::tags$br()
|
||||||
),
|
),
|
||||||
|
@ -279,11 +266,11 @@ ui_elements <- function(selection) {
|
||||||
width = 4,
|
width = 4,
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_cut",
|
inputId = "modal_cut",
|
||||||
label = i18n$t("New factor"),
|
label = "New factor",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::helpText(i18n$t("Create factor/categorical variable from a continous variable (number/date/time).")),
|
shiny::helpText("Create factor/categorical variable from a continous variable (number/date/time)."),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br()
|
shiny::tags$br()
|
||||||
),
|
),
|
||||||
|
@ -291,30 +278,30 @@ ui_elements <- function(selection) {
|
||||||
width = 4,
|
width = 4,
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_column",
|
inputId = "modal_column",
|
||||||
label = i18n$t("New variable"),
|
label = "New variable",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::helpText(i18n$t("Create a new variable based on an R-expression.")),
|
shiny::helpText(shiny::markdown("Create a new variable/column based on an *R*-expression.")),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br()
|
shiny::tags$br()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
tags$h4(i18n$t("Compare modified data to original")),
|
tags$h4("Compare modified data to original"),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$p(
|
shiny::tags$p(
|
||||||
i18n$t("Raw print of the original vs the modified data.")
|
"Raw print of the original vs the modified data."
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
shiny::tags$b(i18n$t("Original data:")),
|
shiny::tags$b("Original data:"),
|
||||||
shiny::verbatimTextOutput("original_str")
|
shiny::verbatimTextOutput("original_str")
|
||||||
),
|
),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
shiny::tags$b(i18n$t("Modified data:")),
|
shiny::tags$b("Modified data:"),
|
||||||
shiny::verbatimTextOutput("modified_str")
|
shiny::verbatimTextOutput("modified_str")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -337,7 +324,7 @@ ui_elements <- function(selection) {
|
||||||
##############################################################################
|
##############################################################################
|
||||||
"describe" =
|
"describe" =
|
||||||
bslib::nav_menu(
|
bslib::nav_menu(
|
||||||
title = i18n$t("Evaluate"),
|
title = "Evaluate",
|
||||||
icon = shiny::icon("magnifying-glass-chart"),
|
icon = shiny::icon("magnifying-glass-chart"),
|
||||||
value = "nav_describe",
|
value = "nav_describe",
|
||||||
# id = "navdescribe",
|
# id = "navdescribe",
|
||||||
|
@ -444,14 +431,14 @@ ui_elements <- function(selection) {
|
||||||
),
|
),
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#########
|
#########
|
||||||
######### Visuals panel
|
######### Download panel
|
||||||
#########
|
#########
|
||||||
##############################################################################
|
##############################################################################
|
||||||
"visuals" = do.call(
|
"visuals" = do.call(
|
||||||
bslib::nav_panel,
|
bslib::nav_panel,
|
||||||
c(
|
c(
|
||||||
list(
|
list(
|
||||||
title = i18n$t("Visuals"),
|
title = "Visuals",
|
||||||
icon = shiny::icon("chart-line"),
|
icon = shiny::icon("chart-line"),
|
||||||
value = "nav_visuals"
|
value = "nav_visuals"
|
||||||
),
|
),
|
||||||
|
@ -472,7 +459,7 @@ ui_elements <- function(selection) {
|
||||||
##############################################################################
|
##############################################################################
|
||||||
"analyze" =
|
"analyze" =
|
||||||
bslib::nav_panel(
|
bslib::nav_panel(
|
||||||
title = i18n$t("Regression"),
|
title = "Regression",
|
||||||
icon = shiny::icon("calculator"),
|
icon = shiny::icon("calculator"),
|
||||||
value = "nav_analyses",
|
value = "nav_analyses",
|
||||||
do.call(
|
do.call(
|
||||||
|
@ -487,20 +474,18 @@ ui_elements <- function(selection) {
|
||||||
##############################################################################
|
##############################################################################
|
||||||
"download" =
|
"download" =
|
||||||
bslib::nav_panel(
|
bslib::nav_panel(
|
||||||
title = i18n$t("Download"),
|
title = "Download",
|
||||||
icon = shiny::icon("download"),
|
icon = shiny::icon("download"),
|
||||||
value = "nav_download",
|
value = "nav_download",
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
shiny::column(width = 2),
|
shiny::column(width = 2),
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 8,
|
width = 8,
|
||||||
shiny::h4(i18n$t("Analysis validation")),
|
|
||||||
validation_ui("validation_all"),
|
|
||||||
shiny::fluidRow(
|
shiny::fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
shiny::h4(i18n$t("Report")),
|
shiny::h4("Report"),
|
||||||
shiny::helpText(i18n$t("Choose your favourite output file format for further work, and download, when the analyses are done.")),
|
shiny::helpText("Choose your favourite output file format for further work, and download, when the analyses are done."),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::br(),
|
shiny::br(),
|
||||||
shiny::selectInput(
|
shiny::selectInput(
|
||||||
|
@ -605,13 +590,14 @@ ui_elements <- function(selection) {
|
||||||
# shiny::br()
|
# shiny::br()
|
||||||
# )
|
# )
|
||||||
)
|
)
|
||||||
if (!is.null(selection)) {
|
if (!is.null(selection)){
|
||||||
out[[selection]]
|
out[[selection]]
|
||||||
} else {
|
} else {
|
||||||
out
|
out
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# ls <- list("home"=1:4,
|
# ls <- list("home"=1:4,
|
||||||
# "test"=1:4)
|
# "test"=1:4)
|
||||||
|
|
|
@ -33,7 +33,7 @@ update_factor_ui <- function(id) {
|
||||||
width = 6,
|
width = 6,
|
||||||
shinyWidgets::virtualSelectInput(
|
shinyWidgets::virtualSelectInput(
|
||||||
inputId = ns("variable"),
|
inputId = ns("variable"),
|
||||||
label = i18n$t("Factor variable to reorder:"),
|
label = i18n("Factor variable to reorder:"),
|
||||||
choices = NULL,
|
choices = NULL,
|
||||||
width = "100%",
|
width = "100%",
|
||||||
zIndex = 50
|
zIndex = 50
|
||||||
|
@ -46,7 +46,7 @@ update_factor_ui <- function(id) {
|
||||||
inputId = ns("sort_levels"),
|
inputId = ns("sort_levels"),
|
||||||
label = tagList(
|
label = tagList(
|
||||||
phosphoricons::ph("sort-ascending"),
|
phosphoricons::ph("sort-ascending"),
|
||||||
i18n$t("Sort by levels")
|
datamods:::i18n("Sort by levels")
|
||||||
),
|
),
|
||||||
class = "btn-outline-primary mb-3",
|
class = "btn-outline-primary mb-3",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
|
@ -59,7 +59,7 @@ update_factor_ui <- function(id) {
|
||||||
inputId = ns("sort_occurrences"),
|
inputId = ns("sort_occurrences"),
|
||||||
label = tagList(
|
label = tagList(
|
||||||
phosphoricons::ph("sort-ascending"),
|
phosphoricons::ph("sort-ascending"),
|
||||||
i18n$t("Sort by count")
|
datamods:::i18n("Sort by count")
|
||||||
),
|
),
|
||||||
class = "btn-outline-primary mb-3",
|
class = "btn-outline-primary mb-3",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
|
@ -71,7 +71,7 @@ update_factor_ui <- function(id) {
|
||||||
class = "float-end",
|
class = "float-end",
|
||||||
shinyWidgets::prettyCheckbox(
|
shinyWidgets::prettyCheckbox(
|
||||||
inputId = ns("new_var"),
|
inputId = ns("new_var"),
|
||||||
label = i18n$t("Create a new variable (otherwise replaces the one selected)"),
|
label = datamods:::i18n("Create a new variable (otherwise replaces the one selected)"),
|
||||||
value = FALSE,
|
value = FALSE,
|
||||||
status = "primary",
|
status = "primary",
|
||||||
outline = TRUE,
|
outline = TRUE,
|
||||||
|
@ -79,7 +79,7 @@ update_factor_ui <- function(id) {
|
||||||
),
|
),
|
||||||
actionButton(
|
actionButton(
|
||||||
inputId = ns("create"),
|
inputId = ns("create"),
|
||||||
label = tagList(phosphoricons::ph("arrow-clockwise"), i18n$t("Update factor variable")),
|
label = tagList(phosphoricons::ph("arrow-clockwise"), datamods:::i18n("Update factor variable")),
|
||||||
class = "btn-outline-primary"
|
class = "btn-outline-primary"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -146,13 +146,13 @@ update_factor_server <- function(id, data_r = reactive(NULL)) {
|
||||||
decreasing <- FALSE
|
decreasing <- FALSE
|
||||||
label <- tagList(
|
label <- tagList(
|
||||||
phosphoricons::ph("sort-descending"),
|
phosphoricons::ph("sort-descending"),
|
||||||
i18n$t("Sort count")
|
datamods:::i18n("Sort count")
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
decreasing <- TRUE
|
decreasing <- TRUE
|
||||||
label <- tagList(
|
label <- tagList(
|
||||||
phosphoricons::ph("sort-ascending"),
|
phosphoricons::ph("sort-ascending"),
|
||||||
i18n$t("Sort count")
|
datamods:::i18n("Sort count")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
updateActionButton(inputId = "sort_occurrences", label = as.character(label))
|
updateActionButton(inputId = "sort_occurrences", label = as.character(label))
|
||||||
|
@ -179,7 +179,7 @@ update_factor_server <- function(id, data_r = reactive(NULL)) {
|
||||||
grid <- grid_columns(
|
grid <- grid_columns(
|
||||||
grid,
|
grid,
|
||||||
columns = c("Var1", "Var1_toset", "Freq"),
|
columns = c("Var1", "Var1_toset", "Freq"),
|
||||||
header = c(i18n$t("Levels"), "New label", i18n$t("Count"))
|
header = c(datamods:::i18n("Levels"), "New label", datamods:::i18n("Count"))
|
||||||
)
|
)
|
||||||
grid <- grid_colorbar(
|
grid <- grid_colorbar(
|
||||||
grid,
|
grid,
|
||||||
|
@ -241,7 +241,7 @@ update_factor_server <- function(id, data_r = reactive(NULL)) {
|
||||||
#'
|
#'
|
||||||
#' @rdname update-factor
|
#' @rdname update-factor
|
||||||
modal_update_factor <- function(id,
|
modal_update_factor <- function(id,
|
||||||
title = i18n$t("Update levels of a factor"),
|
title = i18n("Update levels of a factor"),
|
||||||
easyClose = TRUE,
|
easyClose = TRUE,
|
||||||
size = "l",
|
size = "l",
|
||||||
footer = NULL) {
|
footer = NULL) {
|
||||||
|
@ -267,7 +267,7 @@ modal_update_factor <- function(id,
|
||||||
#' @importFrom htmltools tagList
|
#' @importFrom htmltools tagList
|
||||||
#' @rdname update-factor
|
#' @rdname update-factor
|
||||||
winbox_update_factor <- function(id,
|
winbox_update_factor <- function(id,
|
||||||
title = i18n$t("Update levels of a factor"),
|
title = i18n("Update levels of a factor"),
|
||||||
options = shinyWidgets::wbOptions(),
|
options = shinyWidgets::wbOptions(),
|
||||||
controls = shinyWidgets::wbControls()) {
|
controls = shinyWidgets::wbControls()) {
|
||||||
ns <- NS(id)
|
ns <- NS(id)
|
||||||
|
|
|
@ -13,7 +13,7 @@ update_variables_ui <- function(id, title = "") {
|
||||||
ns <- NS(id)
|
ns <- NS(id)
|
||||||
if (isTRUE(title)) {
|
if (isTRUE(title)) {
|
||||||
title <- htmltools::tags$h4(
|
title <- htmltools::tags$h4(
|
||||||
i18n$t("Update & select variables"),
|
i18n("Update & select variables"),
|
||||||
class = "datamods-title"
|
class = "datamods-title"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -35,19 +35,19 @@ update_variables_ui <- function(id, title = "") {
|
||||||
),
|
),
|
||||||
shinyWidgets::textInputIcon(
|
shinyWidgets::textInputIcon(
|
||||||
inputId = ns("format"),
|
inputId = ns("format"),
|
||||||
label = i18n$t("Date format:"),
|
label = i18n("Date format:"),
|
||||||
value = "%Y-%m-%d",
|
value = "%Y-%m-%d",
|
||||||
icon = list(phosphoricons::ph("clock"))
|
icon = list(phosphoricons::ph("clock"))
|
||||||
),
|
),
|
||||||
shinyWidgets::textInputIcon(
|
shinyWidgets::textInputIcon(
|
||||||
inputId = ns("origin"),
|
inputId = ns("origin"),
|
||||||
label = i18n$t("Date to use as origin to convert date/datetime:"),
|
label = i18n("Date to use as origin to convert date/datetime:"),
|
||||||
value = "1970-01-01",
|
value = "1970-01-01",
|
||||||
icon = list(phosphoricons::ph("calendar"))
|
icon = list(phosphoricons::ph("calendar"))
|
||||||
),
|
),
|
||||||
shinyWidgets::textInputIcon(
|
shinyWidgets::textInputIcon(
|
||||||
inputId = ns("dec"),
|
inputId = ns("dec"),
|
||||||
label = i18n$t("Decimal separator:"),
|
label = i18n("Decimal separator:"),
|
||||||
value = ".",
|
value = ".",
|
||||||
icon = list("0.00")
|
icon = list("0.00")
|
||||||
)
|
)
|
||||||
|
@ -75,8 +75,8 @@ update_variables_ui <- function(id, title = "") {
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = ns("validate"),
|
inputId = ns("validate"),
|
||||||
label = htmltools::tagList(
|
label = htmltools::tagList(
|
||||||
phosphoricons::ph("arrow-circle-right", title = i18n$t("Apply changes")),
|
phosphoricons::ph("arrow-circle-right", title = datamods::i18n("Apply changes")),
|
||||||
i18n$t("Apply changes")
|
datamods::i18n("Apply changes")
|
||||||
),
|
),
|
||||||
width = "100%"
|
width = "100%"
|
||||||
)
|
)
|
||||||
|
@ -115,11 +115,12 @@ update_variables_server <- function(id,
|
||||||
output$data_info <- shiny::renderUI({
|
output$data_info <- shiny::renderUI({
|
||||||
shiny::req(data_r())
|
shiny::req(data_r())
|
||||||
data_description(data_r())
|
data_description(data_r())
|
||||||
|
# sprintf(i18n("Data has %s observations and %s variables."), nrow(data), ncol(data))
|
||||||
})
|
})
|
||||||
|
|
||||||
variables_r <- shiny::reactive({
|
variables_r <- shiny::reactive({
|
||||||
shiny::validate(
|
shiny::validate(
|
||||||
shiny::need(data(), i18n$t("No data to display."))
|
shiny::need(data(), i18n("No data to display."))
|
||||||
)
|
)
|
||||||
data <- data_r()
|
data <- data_r()
|
||||||
if (isTRUE(return_data_on_init)) {
|
if (isTRUE(return_data_on_init)) {
|
||||||
|
@ -224,7 +225,7 @@ update_variables_server <- function(id,
|
||||||
datamods:::insert_alert(
|
datamods:::insert_alert(
|
||||||
selector = ns("update"),
|
selector = ns("update"),
|
||||||
status = "success",
|
status = "success",
|
||||||
tags$b(phosphoricons::ph("check"), i18n$t("Data successfully updated!"))
|
tags$b(phosphoricons::ph("check"), datamods::i18n("Data successfully updated!"))
|
||||||
)
|
)
|
||||||
updated_data$x <- data
|
updated_data$x <- data
|
||||||
updated_data$list_rename <- list_rename
|
updated_data$list_rename <- list_rename
|
||||||
|
@ -803,4 +804,3 @@ clean_date <- function(data) {
|
||||||
}) |>
|
}) |>
|
||||||
unname()
|
unname()
|
||||||
}
|
}
|
||||||
#
|
|
||||||
|
|
390
R/validation.R
390
R/validation.R
|
@ -1,390 +0,0 @@
|
||||||
# Description of warning with text description incl metric
|
|
||||||
# Color coded (green (OK) or yellow (WARNING))
|
|
||||||
# option to ignore/accept warnings ### to simplify things, this is gone for now ###
|
|
||||||
# Only show warnings based on performed analyses
|
|
||||||
|
|
||||||
## 250825
|
|
||||||
## Works in demo
|
|
||||||
## Not alert is printed in app interface
|
|
||||||
## I believe it comes down to the reactivity
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
############# Server and UI
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
#' @title Validation module
|
|
||||||
#'
|
|
||||||
#' @description Check that a dataset respect some validation expectations.
|
|
||||||
#'
|
|
||||||
#' @param id Module's ID.
|
|
||||||
#' @param max_height Maximum height for validation results element, useful if you have many rules.
|
|
||||||
#' @param ... Arguments passed to \code{actionButton} or \code{uiOutput} depending on display mode,
|
|
||||||
#' you cannot use \code{inputId}/\code{outputId}, \code{label} or \code{icon} (button only).
|
|
||||||
#'
|
|
||||||
#' @return
|
|
||||||
#' * UI: HTML tags that can be included in shiny's UI
|
|
||||||
#' * Server: a \code{list} with two slots:
|
|
||||||
#' + **status**: a \code{reactive} function returning the best status available between \code{"OK"}, \code{"Failed"} or \code{"Error"}.
|
|
||||||
#' + **details**: a \code{reactive} function returning a \code{list} with validation details.
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @rdname validation
|
|
||||||
#'
|
|
||||||
#' @example examples/validation_module_demo.R
|
|
||||||
validation_ui <- function(id, max_height = NULL, ...) {
|
|
||||||
ns <- shiny::NS(id)
|
|
||||||
|
|
||||||
max_height <- if (!is.null(max_height)) {
|
|
||||||
paste0("overflow-y: auto; max-height:", htmltools::validateCssUnit(max_height), ";")
|
|
||||||
}
|
|
||||||
|
|
||||||
ui <- shiny::uiOutput(
|
|
||||||
outputId = ns("results"),
|
|
||||||
...,
|
|
||||||
style = max_height
|
|
||||||
)
|
|
||||||
|
|
||||||
htmltools::tagList(
|
|
||||||
ui, datamods:::html_dependency_datamods()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @param data a \code{reactive} function returning a \code{data.frame}.
|
|
||||||
#'
|
|
||||||
#' @rdname validation
|
|
||||||
#'
|
|
||||||
validation_server <- function(id,
|
|
||||||
data) {
|
|
||||||
moduleServer(
|
|
||||||
id = id,
|
|
||||||
module = function(input, output, session) {
|
|
||||||
valid_ui <- reactiveValues(x = NULL)
|
|
||||||
|
|
||||||
data_r <- if (shiny::is.reactive(data)) data else shiny::reactive(data)
|
|
||||||
|
|
||||||
# observeEvent(data_r(), {
|
|
||||||
# to_validate <- data()
|
|
||||||
# valid_dims <- check_data(to_validate, n_row = n_row, n_col = n_col)
|
|
||||||
#
|
|
||||||
# if (all(c(valid_dims$nrows, valid_dims$ncols))) {
|
|
||||||
# valid_status <- "OK"
|
|
||||||
# } else {
|
|
||||||
# valid_status <- "Failed"
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# valid_results <- lapply(
|
|
||||||
# X = c("nrows", "ncols"),
|
|
||||||
# FUN = function(x) {
|
|
||||||
# if (is.null(valid_dims[[x]]))
|
|
||||||
# return(NULL)
|
|
||||||
# label <- switch(
|
|
||||||
# x,
|
|
||||||
# "nrows" = n_row_label,
|
|
||||||
# "ncols" = n_col_label
|
|
||||||
# )
|
|
||||||
# list(
|
|
||||||
# status = ifelse(valid_dims[[x]], "OK", "Failed"),
|
|
||||||
# label = paste0("<b>", label, "</b>")
|
|
||||||
# )
|
|
||||||
# }
|
|
||||||
# )
|
|
||||||
|
|
||||||
shiny::observeEvent(
|
|
||||||
data_r(),
|
|
||||||
{
|
|
||||||
# browser()
|
|
||||||
to_validate <- data_r()
|
|
||||||
if (is.reactivevalues(to_validate))
|
|
||||||
out <- lapply(
|
|
||||||
reactiveValuesToList(to_validate),
|
|
||||||
make_validation_alerts) |>
|
|
||||||
purrr::list_flatten()
|
|
||||||
|
|
||||||
if (length(to_validate) > 0) {
|
|
||||||
out <- make_validation_alerts(to_validate)
|
|
||||||
}
|
|
||||||
valid_ui$x <- tagList(out)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
output$results <- renderUI({
|
|
||||||
valid_ui$x
|
|
||||||
})
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
############# Validation functions
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
#' Dimensions validation
|
|
||||||
#'
|
|
||||||
#' @param before data before
|
|
||||||
#' @param after data after
|
|
||||||
#' @param fun dimension function. ncol or nrow
|
|
||||||
#'
|
|
||||||
#' @returns data.frame
|
|
||||||
#'
|
|
||||||
dim_change_call <- function(before, after, fun) {
|
|
||||||
# browser()
|
|
||||||
if (!0 %in% c(dim(before), dim(after))) {
|
|
||||||
n_before <- fun(before)
|
|
||||||
n_after <- fun(after)
|
|
||||||
n_out <- n_before - n_after
|
|
||||||
p_after <- n_after / fun(before) * 100
|
|
||||||
p_out <- 100 - p_after
|
|
||||||
|
|
||||||
data.frame(
|
|
||||||
n_before = n_before,
|
|
||||||
n_after = n_after,
|
|
||||||
n_out = n_out,
|
|
||||||
p_after = p_after,
|
|
||||||
p_out = p_out
|
|
||||||
) |>
|
|
||||||
dplyr::mutate(
|
|
||||||
dplyr::across(
|
|
||||||
dplyr::where(
|
|
||||||
is.numeric
|
|
||||||
),
|
|
||||||
\(.y) round(.y, 0)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
data.frame(NULL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#' Variable filter test wrapper
|
|
||||||
#'
|
|
||||||
#' @param before data before
|
|
||||||
#' @param after data after
|
|
||||||
#'
|
|
||||||
#' @returns vector
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' vars_filter_validate(mtcars, mtcars[1:6])
|
|
||||||
#' vars_filter_validate(mtcars, mtcars[0])
|
|
||||||
vars_filter_validate <- function(before, after) {
|
|
||||||
dim_change_call(before, after, ncol)
|
|
||||||
}
|
|
||||||
|
|
||||||
#' Observations filter test wrapper
|
|
||||||
#'
|
|
||||||
#' @param before data before
|
|
||||||
#' @param after data after
|
|
||||||
#'
|
|
||||||
#' @returns vector
|
|
||||||
#'
|
|
||||||
obs_filter_validate <- function(before, after) {
|
|
||||||
dim_change_call(before, after, nrow)
|
|
||||||
}
|
|
||||||
|
|
||||||
#' Validate function of missingness in data
|
|
||||||
#'
|
|
||||||
#' @param data data set
|
|
||||||
#'
|
|
||||||
#' @returns data.frame
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' df <- mtcars
|
|
||||||
#' df[1,2:4] <- NA
|
|
||||||
#' missings_validate(df)
|
|
||||||
missings_validate <- function(data){
|
|
||||||
if (!0 %in% dim(data)) {
|
|
||||||
# browser()
|
|
||||||
p_miss <- sum(is.na(data))/prod(dim(data))*100
|
|
||||||
data.frame(
|
|
||||||
p_miss = p_miss
|
|
||||||
) |>
|
|
||||||
dplyr::mutate(
|
|
||||||
dplyr::across(
|
|
||||||
dplyr::where(
|
|
||||||
is.numeric
|
|
||||||
),
|
|
||||||
\(.y) signif(.y, 2)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
data.frame(NULL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
############# Collected validation functions in a library-like function
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
|
|
||||||
#' Validation library
|
|
||||||
#'
|
|
||||||
#' @param name Index name
|
|
||||||
#'
|
|
||||||
#' @returns list
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' validation_lib()
|
|
||||||
#' validation_lib("missings")
|
|
||||||
validation_lib <- function(name=NULL) {
|
|
||||||
ls <- list(
|
|
||||||
"obs_filter" = function(x, y) {
|
|
||||||
## Validation function for observations filter
|
|
||||||
list(
|
|
||||||
string = i18n$t("You removed {p_out} % of observations."),
|
|
||||||
summary.fun = obs_filter_validate,
|
|
||||||
summary.fun.args = list(
|
|
||||||
before = x,
|
|
||||||
after = y
|
|
||||||
),
|
|
||||||
test.fun = function(x, var, cut) {
|
|
||||||
test.var <- x[var]
|
|
||||||
ifelse(test.var > cut, "warning", "succes")
|
|
||||||
},
|
|
||||||
test.fun.args = list(var = "p_out", cut = 50)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
"var_filter" = function(x, y) {
|
|
||||||
## Validation function for variables filter
|
|
||||||
list(
|
|
||||||
string = i18n$t("You removed {p_out} % of variables."),
|
|
||||||
summary.fun = vars_filter_validate,
|
|
||||||
summary.fun.args = list(
|
|
||||||
before = x,
|
|
||||||
after = y
|
|
||||||
),
|
|
||||||
test.fun = function(x, var, cut) {
|
|
||||||
test.var <- x[var]
|
|
||||||
ifelse(test.var > cut, "warning", "succes")
|
|
||||||
},
|
|
||||||
test.fun.args = list(var = "p_out", cut = 50)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
"missings" = function(x, y) {
|
|
||||||
### Placeholder for missingness validation
|
|
||||||
list(
|
|
||||||
string = "There are {p_miss} % missing observations.",
|
|
||||||
summary.fun = missings_validate,
|
|
||||||
summary.fun.args = list(
|
|
||||||
data = x
|
|
||||||
),
|
|
||||||
test.fun = function(x, var, cut) {
|
|
||||||
test.var <- x[var]
|
|
||||||
ifelse(test.var > cut, "warning", "succes")
|
|
||||||
},
|
|
||||||
test.fun.args = list(var = "p_miss", cut = 30)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!is.null(name)){
|
|
||||||
name <- match.arg(name,choices = names(ls))
|
|
||||||
ls[[name]]
|
|
||||||
} else {
|
|
||||||
ls
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
############# Validation creation
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
#' Create validation data.frame
|
|
||||||
#'
|
|
||||||
#' @param ls validation list
|
|
||||||
#' @param ... magic dots
|
|
||||||
#'
|
|
||||||
#' @returns data.frame
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' i18n <- shiny.i18n::Translator$new(translation_csvs_path = here::here("inst/translations"))
|
|
||||||
#' i18n$set_translation_language("en")
|
|
||||||
#' df_original <- mtcars
|
|
||||||
#' df_original[1,2:4] <- NA
|
|
||||||
#' df_obs <- df_original |> dplyr::filter(carb==4)
|
|
||||||
#' df_vars <- df_original[1:7]
|
|
||||||
#' val <- purrr::map2(
|
|
||||||
#' .x = validation_lib(),
|
|
||||||
#' .y = list(
|
|
||||||
#' list(x = df_original, y = df_obs),
|
|
||||||
#' list(x = df_original, y = df_vars),
|
|
||||||
#' list(x=df_original)),
|
|
||||||
#' make_validation
|
|
||||||
#' )
|
|
||||||
#' val |> make_validation_alerts()
|
|
||||||
#'
|
|
||||||
#' val2 <- purrr::map2(
|
|
||||||
#' .x = validation_lib()[2],
|
|
||||||
#' .y = list(list(x = mtcars, y = mtcars[0])),
|
|
||||||
#' make_validation
|
|
||||||
#' )
|
|
||||||
#' val2 |> make_validation_alerts()
|
|
||||||
#'
|
|
||||||
#' val3 <- make_validation(
|
|
||||||
#' ls = validation_lib()[[2]],
|
|
||||||
#' list(x = mtcars, y = mtcars[0])
|
|
||||||
#' )
|
|
||||||
make_validation <- function(ls, ...) {
|
|
||||||
ls <- do.call(ls, ...)
|
|
||||||
|
|
||||||
df <- do.call(ls$summary.fun, ls$summary.fun.args)
|
|
||||||
|
|
||||||
if (!any(dim(df) == c(0))) {
|
|
||||||
label <- with(df, {
|
|
||||||
glue::glue(ls$string)
|
|
||||||
})
|
|
||||||
|
|
||||||
# browser()
|
|
||||||
status <- do.call(ls$test.fun, modifyList(ls$test.fun.args, list(x = df)))
|
|
||||||
|
|
||||||
data.frame(
|
|
||||||
label = label,
|
|
||||||
status = status[1]
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
data.frame(NULL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#' Create alert from validation data.frame
|
|
||||||
#'
|
|
||||||
#' @param data
|
|
||||||
#'
|
|
||||||
#' @export
|
|
||||||
make_validation_alerts <- function(data) {
|
|
||||||
# browser()
|
|
||||||
if (is.data.frame(data)){
|
|
||||||
ls <- list(data)
|
|
||||||
} else {
|
|
||||||
ls <- data
|
|
||||||
}
|
|
||||||
|
|
||||||
lapply(
|
|
||||||
X = ls,
|
|
||||||
FUN = function(x) {
|
|
||||||
# browser()
|
|
||||||
if (!is.null(dim(x)) && !any(dim(x) == c(0))) {
|
|
||||||
icon <- switch(x$status,
|
|
||||||
"succes" = phosphoricons::ph("check", title = "OK"),
|
|
||||||
"warning" = phosphoricons::ph("warning", title = "Warning")
|
|
||||||
)
|
|
||||||
|
|
||||||
shinyWidgets::alert(
|
|
||||||
icon,
|
|
||||||
htmltools::HTML(x$label),
|
|
||||||
status = x$status,
|
|
||||||
style = "margin-bottom: 10px; padding: 10px;"
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
return(NULL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
28
SESSION.md
28
SESSION.md
|
@ -11,11 +11,11 @@
|
||||||
|collate |en_US.UTF-8 |
|
|collate |en_US.UTF-8 |
|
||||||
|ctype |en_US.UTF-8 |
|
|ctype |en_US.UTF-8 |
|
||||||
|tz |Europe/Copenhagen |
|
|tz |Europe/Copenhagen |
|
||||||
|date |2025-09-10 |
|
|date |2025-08-27 |
|
||||||
|rstudio |2025.05.0+496 Mariposa Orchid (desktop) |
|
|rstudio |2025.05.0+496 Mariposa Orchid (desktop) |
|
||||||
|pandoc |3.6.4 @ /opt/homebrew/bin/ (via rmarkdown) |
|
|pandoc |3.6.4 @ /opt/homebrew/bin/ (via rmarkdown) |
|
||||||
|quarto |1.7.30 @ /usr/local/bin/quarto |
|
|quarto |1.7.30 @ /usr/local/bin/quarto |
|
||||||
|FreesearchR |25.8.3.250910 |
|
|FreesearchR |25.8.2.250827 |
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -26,6 +26,8 @@
|
||||||
|apexcharter |0.4.4 |2024-09-06 |CRAN (R 4.4.1) |
|
|apexcharter |0.4.4 |2024-09-06 |CRAN (R 4.4.1) |
|
||||||
|askpass |1.2.1 |2024-10-04 |CRAN (R 4.4.1) |
|
|askpass |1.2.1 |2024-10-04 |CRAN (R 4.4.1) |
|
||||||
|assertthat |0.2.1 |2019-03-21 |CRAN (R 4.4.1) |
|
|assertthat |0.2.1 |2019-03-21 |CRAN (R 4.4.1) |
|
||||||
|
|attachment |0.4.5 |2025-03-14 |CRAN (R 4.4.1) |
|
||||||
|
|attempt |0.3.1 |2020-05-03 |CRAN (R 4.4.1) |
|
||||||
|backports |1.5.0 |2024-05-23 |CRAN (R 4.4.1) |
|
|backports |1.5.0 |2024-05-23 |CRAN (R 4.4.1) |
|
||||||
|base64enc |0.1-3 |2015-07-28 |CRAN (R 4.4.1) |
|
|base64enc |0.1-3 |2015-07-28 |CRAN (R 4.4.1) |
|
||||||
|bayestestR |0.16.1 |2025-07-01 |CRAN (R 4.4.1) |
|
|bayestestR |0.16.1 |2025-07-01 |CRAN (R 4.4.1) |
|
||||||
|
@ -53,6 +55,7 @@
|
||||||
|colorspace |2.1-1 |2024-07-26 |CRAN (R 4.4.1) |
|
|colorspace |2.1-1 |2024-07-26 |CRAN (R 4.4.1) |
|
||||||
|commonmark |2.0.0 |2025-07-07 |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) |
|
|crayon |1.5.3 |2024-06-20 |CRAN (R 4.4.1) |
|
||||||
|
|credentials |2.0.2 |2024-10-04 |CRAN (R 4.4.1) |
|
||||||
|curl |6.4.0 |2025-06-22 |CRAN (R 4.4.1) |
|
|curl |6.4.0 |2025-06-22 |CRAN (R 4.4.1) |
|
||||||
|data.table |1.17.8 |2025-07-10 |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) |
|
|datamods |1.5.3 |2024-10-02 |CRAN (R 4.4.1) |
|
||||||
|
@ -62,6 +65,7 @@
|
||||||
|devtools |2.4.5 |2022-10-11 |CRAN (R 4.4.0) |
|
|devtools |2.4.5 |2022-10-11 |CRAN (R 4.4.0) |
|
||||||
|DHARMa |0.4.7 |2024-10-18 |CRAN (R 4.4.1) |
|
|DHARMa |0.4.7 |2024-10-18 |CRAN (R 4.4.1) |
|
||||||
|digest |0.6.37 |2024-08-19 |CRAN (R 4.4.1) |
|
|digest |0.6.37 |2024-08-19 |CRAN (R 4.4.1) |
|
||||||
|
|dockerfiler |0.2.5 |2025-05-07 |CRAN (R 4.4.1) |
|
||||||
|doParallel |1.0.17 |2022-02-07 |CRAN (R 4.4.0) |
|
|doParallel |1.0.17 |2022-02-07 |CRAN (R 4.4.0) |
|
||||||
|dplyr |1.1.4 |2023-11-17 |CRAN (R 4.4.0) |
|
|dplyr |1.1.4 |2023-11-17 |CRAN (R 4.4.0) |
|
||||||
|DT |0.33 |2024-04-04 |CRAN (R 4.4.0) |
|
|DT |0.33 |2024-04-04 |CRAN (R 4.4.0) |
|
||||||
|
@ -84,16 +88,19 @@
|
||||||
|foreach |1.5.2 |2022-02-02 |CRAN (R 4.4.0) |
|
|foreach |1.5.2 |2022-02-02 |CRAN (R 4.4.0) |
|
||||||
|foreign |0.8-90 |2025-03-31 |CRAN (R 4.4.1) |
|
|foreign |0.8-90 |2025-03-31 |CRAN (R 4.4.1) |
|
||||||
|Formula |1.2-5 |2023-02-24 |CRAN (R 4.4.1) |
|
|Formula |1.2-5 |2023-02-24 |CRAN (R 4.4.1) |
|
||||||
|FreesearchR |25.8.3 |NA |NA |
|
|FreesearchR |25.8.2 |NA |NA |
|
||||||
|fs |1.6.6 |2025-04-12 |CRAN (R 4.4.1) |
|
|fs |1.6.6 |2025-04-12 |CRAN (R 4.4.1) |
|
||||||
|gdtools |0.4.2 |2025-03-27 |CRAN (R 4.4.1) |
|
|gdtools |0.4.2 |2025-03-27 |CRAN (R 4.4.1) |
|
||||||
|generics |0.1.4 |2025-05-09 |CRAN (R 4.4.1) |
|
|generics |0.1.4 |2025-05-09 |CRAN (R 4.4.1) |
|
||||||
|
|gert |2.1.5 |2025-03-25 |CRAN (R 4.4.1) |
|
||||||
|ggalluvial |0.12.5 |2023-02-22 |CRAN (R 4.4.0) |
|
|ggalluvial |0.12.5 |2023-02-22 |CRAN (R 4.4.0) |
|
||||||
|ggcorrplot |0.1.4.1 |2023-09-05 |CRAN (R 4.4.0) |
|
|ggcorrplot |0.1.4.1 |2023-09-05 |CRAN (R 4.4.0) |
|
||||||
|ggforce |0.5.0 |2025-06-18 |CRAN (R 4.4.1) |
|
|ggforce |0.5.0 |2025-06-18 |CRAN (R 4.4.1) |
|
||||||
|ggplot2 |3.5.2 |2025-04-09 |CRAN (R 4.4.1) |
|
|ggplot2 |3.5.2 |2025-04-09 |CRAN (R 4.4.1) |
|
||||||
|ggridges |0.5.6 |2024-01-23 |CRAN (R 4.4.0) |
|
|ggridges |0.5.6 |2024-01-23 |CRAN (R 4.4.0) |
|
||||||
|ggstats |0.10.0 |2025-07-02 |CRAN (R 4.4.1) |
|
|ggstats |0.10.0 |2025-07-02 |CRAN (R 4.4.1) |
|
||||||
|
|gh |1.5.0 |2025-05-26 |CRAN (R 4.4.1) |
|
||||||
|
|gitcreds |0.1.2 |2022-09-08 |CRAN (R 4.4.1) |
|
||||||
|glue |1.8.0 |2024-09-30 |CRAN (R 4.4.1) |
|
|glue |1.8.0 |2024-09-30 |CRAN (R 4.4.1) |
|
||||||
|gridExtra |2.3 |2017-09-09 |CRAN (R 4.4.1) |
|
|gridExtra |2.3 |2017-09-09 |CRAN (R 4.4.1) |
|
||||||
|gt |1.0.0 |2025-04-05 |CRAN (R 4.4.1) |
|
|gt |1.0.0 |2025-04-05 |CRAN (R 4.4.1) |
|
||||||
|
@ -107,6 +114,7 @@
|
||||||
|htmltools |0.5.8.1 |2024-04-04 |CRAN (R 4.4.1) |
|
|htmltools |0.5.8.1 |2024-04-04 |CRAN (R 4.4.1) |
|
||||||
|htmlwidgets |1.6.4 |2023-12-06 |CRAN (R 4.4.0) |
|
|htmlwidgets |1.6.4 |2023-12-06 |CRAN (R 4.4.0) |
|
||||||
|httpuv |1.6.16 |2025-04-16 |CRAN (R 4.4.1) |
|
|httpuv |1.6.16 |2025-04-16 |CRAN (R 4.4.1) |
|
||||||
|
|httr2 |1.2.1 |2025-07-22 |CRAN (R 4.4.1) |
|
||||||
|IDEAFilter |0.2.1 |2025-07-29 |CRAN (R 4.4.1) |
|
|IDEAFilter |0.2.1 |2025-07-29 |CRAN (R 4.4.1) |
|
||||||
|insight |1.4.0 |2025-08-18 |CRAN (R 4.4.1) |
|
|insight |1.4.0 |2025-08-18 |CRAN (R 4.4.1) |
|
||||||
|iterators |1.0.14 |2022-02-05 |CRAN (R 4.4.1) |
|
|iterators |1.0.14 |2022-02-05 |CRAN (R 4.4.1) |
|
||||||
|
@ -119,9 +127,11 @@
|
||||||
|later |1.4.2 |2025-04-08 |CRAN (R 4.4.1) |
|
|later |1.4.2 |2025-04-08 |CRAN (R 4.4.1) |
|
||||||
|lattice |0.22-7 |2025-04-02 |CRAN (R 4.4.1) |
|
|lattice |0.22-7 |2025-04-02 |CRAN (R 4.4.1) |
|
||||||
|lifecycle |1.0.4 |2023-11-07 |CRAN (R 4.4.1) |
|
|lifecycle |1.0.4 |2023-11-07 |CRAN (R 4.4.1) |
|
||||||
|
|litedown |0.7 |2025-04-08 |CRAN (R 4.4.1) |
|
||||||
|lme4 |1.1-37 |2025-03-26 |CRAN (R 4.4.1) |
|
|lme4 |1.1-37 |2025-03-26 |CRAN (R 4.4.1) |
|
||||||
|lubridate |1.9.4 |2024-12-08 |CRAN (R 4.4.1) |
|
|lubridate |1.9.4 |2024-12-08 |CRAN (R 4.4.1) |
|
||||||
|magrittr |2.0.3 |2022-03-30 |CRAN (R 4.4.1) |
|
|magrittr |2.0.3 |2022-03-30 |CRAN (R 4.4.1) |
|
||||||
|
|markdown |2.0 |2025-03-23 |CRAN (R 4.4.1) |
|
||||||
|MASS |7.3-65 |2025-02-28 |CRAN (R 4.4.1) |
|
|MASS |7.3-65 |2025-02-28 |CRAN (R 4.4.1) |
|
||||||
|Matrix |1.7-3 |2025-03-11 |CRAN (R 4.4.1) |
|
|Matrix |1.7-3 |2025-03-11 |CRAN (R 4.4.1) |
|
||||||
|memoise |2.0.1 |2021-11-26 |CRAN (R 4.4.0) |
|
|memoise |2.0.1 |2021-11-26 |CRAN (R 4.4.0) |
|
||||||
|
@ -137,6 +147,7 @@
|
||||||
|opdisDownsampling |1.0.1 |2024-04-15 |CRAN (R 4.4.0) |
|
|opdisDownsampling |1.0.1 |2024-04-15 |CRAN (R 4.4.0) |
|
||||||
|openssl |2.3.3 |2025-05-26 |CRAN (R 4.4.1) |
|
|openssl |2.3.3 |2025-05-26 |CRAN (R 4.4.1) |
|
||||||
|openxlsx2 |1.18 |2025-07-29 |CRAN (R 4.4.1) |
|
|openxlsx2 |1.18 |2025-07-29 |CRAN (R 4.4.1) |
|
||||||
|
|pak |0.9.0 |2025-05-27 |CRAN (R 4.4.1) |
|
||||||
|parameters |0.27.0 |2025-07-09 |CRAN (R 4.4.1) |
|
|parameters |0.27.0 |2025-07-09 |CRAN (R 4.4.1) |
|
||||||
|patchwork |1.3.1 |2025-06-21 |CRAN (R 4.4.1) |
|
|patchwork |1.3.1 |2025-06-21 |CRAN (R 4.4.1) |
|
||||||
|pbmcapply |1.5.1 |2022-04-28 |CRAN (R 4.4.1) |
|
|pbmcapply |1.5.1 |2022-04-28 |CRAN (R 4.4.1) |
|
||||||
|
@ -158,10 +169,6 @@
|
||||||
|qqconf |1.3.2 |2023-04-14 |CRAN (R 4.4.0) |
|
|qqconf |1.3.2 |2023-04-14 |CRAN (R 4.4.0) |
|
||||||
|qqplotr |0.0.6 |2023-01-25 |CRAN (R 4.4.0) |
|
|qqplotr |0.0.6 |2023-01-25 |CRAN (R 4.4.0) |
|
||||||
|quarto |1.5.0 |2025-07-28 |RSPM (R 4.4.0) |
|
|quarto |1.5.0 |2025-07-28 |RSPM (R 4.4.0) |
|
||||||
|R.cache |0.17.0 |2025-05-02 |CRAN (R 4.4.1) |
|
|
||||||
|R.methodsS3 |1.8.2 |2022-06-13 |CRAN (R 4.4.1) |
|
|
||||||
|R.oo |1.27.1 |2025-05-02 |CRAN (R 4.4.1) |
|
|
||||||
|R.utils |2.13.0 |2025-02-24 |CRAN (R 4.4.1) |
|
|
||||||
|R6 |2.6.1 |2025-02-15 |CRAN (R 4.4.1) |
|
|R6 |2.6.1 |2025-02-15 |CRAN (R 4.4.1) |
|
||||||
|ragg |1.4.0 |2025-04-10 |CRAN (R 4.4.1) |
|
|ragg |1.4.0 |2025-04-10 |CRAN (R 4.4.1) |
|
||||||
|rankinPlot |1.1.0 |2023-01-30 |CRAN (R 4.4.0) |
|
|rankinPlot |1.1.0 |2023-01-30 |CRAN (R 4.4.0) |
|
||||||
|
@ -196,14 +203,15 @@
|
||||||
|see |0.11.0 |2025-03-11 |CRAN (R 4.4.1) |
|
|see |0.11.0 |2025-03-11 |CRAN (R 4.4.1) |
|
||||||
|sessioninfo |1.2.3 |2025-02-05 |CRAN (R 4.4.1) |
|
|sessioninfo |1.2.3 |2025-02-05 |CRAN (R 4.4.1) |
|
||||||
|shiny |1.11.1 |2025-07-03 |CRAN (R 4.4.1) |
|
|shiny |1.11.1 |2025-07-03 |CRAN (R 4.4.1) |
|
||||||
|shiny.i18n |0.3.0 |2023-01-16 |CRAN (R 4.4.0) |
|
|shiny.i18n |0.3.0 |NA |NA |
|
||||||
|
|shiny2docker |0.0.3 |2025-06-28 |CRAN (R 4.4.1) |
|
||||||
|shinybusy |0.3.3 |2024-03-09 |CRAN (R 4.4.0) |
|
|shinybusy |0.3.3 |2024-03-09 |CRAN (R 4.4.0) |
|
||||||
|shinyjs |2.1.0 |2021-12-23 |CRAN (R 4.4.0) |
|
|shinyjs |2.1.0 |2021-12-23 |CRAN (R 4.4.0) |
|
||||||
|shinyTime |1.0.3 |2022-08-19 |CRAN (R 4.4.0) |
|
|shinyTime |1.0.3 |2022-08-19 |CRAN (R 4.4.0) |
|
||||||
|shinyWidgets |0.9.0 |2025-02-21 |CRAN (R 4.4.1) |
|
|shinyWidgets |0.9.0 |2025-02-21 |CRAN (R 4.4.1) |
|
||||||
|stringi |1.8.7 |2025-03-27 |CRAN (R 4.4.1) |
|
|stringi |1.8.7 |2025-03-27 |CRAN (R 4.4.1) |
|
||||||
|stringr |1.5.1 |2023-11-14 |CRAN (R 4.4.0) |
|
|stringr |1.5.1 |2023-11-14 |CRAN (R 4.4.0) |
|
||||||
|styler |1.10.3 |2024-04-07 |CRAN (R 4.4.0) |
|
|sys |3.4.3 |2024-10-04 |CRAN (R 4.4.1) |
|
||||||
|systemfonts |1.2.3 |2025-04-30 |CRAN (R 4.4.1) |
|
|systemfonts |1.2.3 |2025-04-30 |CRAN (R 4.4.1) |
|
||||||
|testthat |3.2.3 |2025-01-13 |CRAN (R 4.4.1) |
|
|testthat |3.2.3 |2025-01-13 |CRAN (R 4.4.1) |
|
||||||
|textshaping |1.0.1 |2025-05-01 |CRAN (R 4.4.1) |
|
|textshaping |1.0.1 |2025-05-01 |CRAN (R 4.4.1) |
|
||||||
|
@ -218,7 +226,6 @@
|
||||||
|tzdb |0.5.0 |2025-03-15 |CRAN (R 4.4.1) |
|
|tzdb |0.5.0 |2025-03-15 |CRAN (R 4.4.1) |
|
||||||
|urlchecker |1.0.1 |2021-11-30 |CRAN (R 4.4.1) |
|
|urlchecker |1.0.1 |2021-11-30 |CRAN (R 4.4.1) |
|
||||||
|usethis |3.1.0 |2024-11-26 |CRAN (R 4.4.1) |
|
|usethis |3.1.0 |2024-11-26 |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) |
|
|uuid |1.2-1 |2024-07-29 |CRAN (R 4.4.1) |
|
||||||
|V8 |6.0.6 |2025-08-18 |CRAN (R 4.4.1) |
|
|V8 |6.0.6 |2025-08-18 |CRAN (R 4.4.1) |
|
||||||
|vctrs |0.6.5 |2023-12-01 |CRAN (R 4.4.0) |
|
|vctrs |0.6.5 |2023-12-01 |CRAN (R 4.4.0) |
|
||||||
|
@ -229,4 +236,5 @@
|
||||||
|xml2 |1.3.8 |2025-03-14 |CRAN (R 4.4.1) |
|
|xml2 |1.3.8 |2025-03-14 |CRAN (R 4.4.1) |
|
||||||
|xtable |1.8-4 |2019-04-21 |CRAN (R 4.4.1) |
|
|xtable |1.8-4 |2019-04-21 |CRAN (R 4.4.1) |
|
||||||
|yaml |2.3.10 |2024-07-26 |CRAN (R 4.4.1) |
|
|yaml |2.3.10 |2024-07-26 |CRAN (R 4.4.1) |
|
||||||
|
|yesno |0.1.3 |2024-07-26 |CRAN (R 4.4.1) |
|
||||||
|zip |2.3.3 |2025-05-13 |CRAN (R 4.4.1) |
|
|zip |2.3.3 |2025-05-13 |CRAN (R 4.4.1) |
|
||||||
|
|
|
@ -1,133 +0,0 @@
|
||||||
#' Data and analyses validation demo
|
|
||||||
#'
|
|
||||||
#' @returns
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' \dontrun{
|
|
||||||
#' validation_demo_app()
|
|
||||||
#' }
|
|
||||||
validation_demo_app <- function() {
|
|
||||||
ui <- shiny::fluidPage(
|
|
||||||
shiny::tags$h2("Validation"),
|
|
||||||
IDEAFilter::IDEAFilter_ui("data_filter"),
|
|
||||||
shiny::br(),
|
|
||||||
DT::DTOutput("data_final"),
|
|
||||||
shiny::br(),
|
|
||||||
validation_ui("validation_demo_2")
|
|
||||||
)
|
|
||||||
|
|
||||||
server <- function(input, output, session) {
|
|
||||||
rv <- shiny::reactiveValues(
|
|
||||||
data_original = shiny::reactive(mtcars),
|
|
||||||
data_filtered = NULL
|
|
||||||
)
|
|
||||||
|
|
||||||
rv_validation <- shiny::reactiveValues(
|
|
||||||
obs_filter = NULL,
|
|
||||||
vars_filter = NULL
|
|
||||||
)
|
|
||||||
|
|
||||||
data_filter <- IDEAFilter::IDEAFilter(
|
|
||||||
id = "data_filter",
|
|
||||||
data = mtcars,
|
|
||||||
verbose = TRUE
|
|
||||||
)
|
|
||||||
|
|
||||||
shiny::observeEvent(
|
|
||||||
data_filter(),
|
|
||||||
{
|
|
||||||
rv$data_filtered <- data_filter()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
output$data_final <- DT::renderDT(
|
|
||||||
data_filter()
|
|
||||||
)
|
|
||||||
|
|
||||||
shiny::observeEvent(
|
|
||||||
list(
|
|
||||||
data_filter()
|
|
||||||
),
|
|
||||||
{
|
|
||||||
to_make_validation <- data_filter()
|
|
||||||
## Validation
|
|
||||||
if (!is.null(to_make_validation)) {
|
|
||||||
validation <-
|
|
||||||
make_validation(
|
|
||||||
ls = validation_lib("obs_filter"),
|
|
||||||
list(
|
|
||||||
x = mtcars,
|
|
||||||
y = to_make_validation
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
rv_validation$vars_filter <- validation
|
|
||||||
|
|
||||||
validation_server(id = "validation_demo_2", data = rv_validation$vars_filter)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
# shiny::observeEvent(
|
|
||||||
# list(
|
|
||||||
# shiny::reactive(rv_validation$vars_filter)(),
|
|
||||||
# data_filter()
|
|
||||||
# ),
|
|
||||||
# {
|
|
||||||
# # browser()
|
|
||||||
# # to_make_alert <- shiny::isolate(rv_validation$vars_filter)
|
|
||||||
# to_make_alert <- shiny::reactive(rv_validation$vars_filter)()
|
|
||||||
# if (!is.null(rv_validation$vars_filter)) {
|
|
||||||
# validation_server(id = "validation_demo_2", data = to_make_alert)
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# )
|
|
||||||
}
|
|
||||||
shiny::shinyApp(ui, server)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#' Title
|
|
||||||
#'
|
|
||||||
#' @returns
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' validation_nr_demo_app()
|
|
||||||
validation_nr_demo_app <- function() {
|
|
||||||
ui <- shiny::fluidPage(
|
|
||||||
shiny::tags$h2("Validation"),
|
|
||||||
shiny::br(),
|
|
||||||
validation_ui("validation_demo_1", max_height = "30px"),
|
|
||||||
shiny::br(),
|
|
||||||
validation_ui("validation_demo_2")
|
|
||||||
)
|
|
||||||
|
|
||||||
server <- function(input, output, session) {
|
|
||||||
df_original <- mtcars
|
|
||||||
|
|
||||||
df_obs <- mtcars |> dplyr::filter(mpg > 20)
|
|
||||||
|
|
||||||
df_vars <- df_obs[1:6]
|
|
||||||
|
|
||||||
val1 <- purrr::map2(
|
|
||||||
.x = validation_lib()[1],
|
|
||||||
.y = list(list(x = df_original, y = df_obs)),
|
|
||||||
make_validation
|
|
||||||
)
|
|
||||||
|
|
||||||
val2 <- make_validation(
|
|
||||||
ls = validation_lib()[[2]],
|
|
||||||
list(x = df_original, y = df_vars)
|
|
||||||
)
|
|
||||||
|
|
||||||
validation_server(id = "validation_demo_1", data = val1)
|
|
||||||
|
|
||||||
validation_server(id = "validation_demo_2", data = val2)
|
|
||||||
}
|
|
||||||
shiny::shinyApp(ui, server)
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#C60C30" d="M32 5H15v11h21V9c0-2.209-1.791-4-4-4zM15 31h17c2.209 0 4-1.791 4-4.5V20H15v11zM0 20v6.5C0 29.209 1.791 31 4 31h7V20H0zM11 5H4C1.791 5 0 6.791 0 9v7h11V5z"/><path fill="#EEE" d="M15 5h-4v11H0v4h11v11h4V20h21v-4H15z"/></svg>
|
|
Before Width: | Height: | Size: 306 B |
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#00247D" d="M0 9.059V13h5.628zM4.664 31H13v-5.837zM23 25.164V31h8.335zM0 23v3.941L5.63 23zM31.337 5H23v5.837zM36 26.942V23h-5.631zM36 13V9.059L30.371 13zM13 5H4.664L13 10.837z"/><path fill="#CF1B2B" d="M25.14 23l9.712 6.801c.471-.479.808-1.082.99-1.749L28.627 23H25.14zM13 23h-2.141l-9.711 6.8c.521.53 1.189.909 1.938 1.085L13 23.943V23zm10-10h2.141l9.711-6.8c-.521-.53-1.188-.909-1.937-1.085L23 12.057V13zm-12.141 0L1.148 6.2C.677 6.68.34 7.282.157 7.949L7.372 13h3.487z"/><path fill="#EEE" d="M36 21H21v10h2v-5.836L31.335 31H32c1.117 0 2.126-.461 2.852-1.199L25.14 23h3.487l7.215 5.052c.093-.337.158-.686.158-1.052v-.058L30.369 23H36v-2zM0 21v2h5.63L0 26.941V27c0 1.091.439 2.078 1.148 2.8l9.711-6.8H13v.943l-9.914 6.941c.294.07.598.116.914.116h.664L13 25.163V31h2V21H0zM36 9c0-1.091-.439-2.078-1.148-2.8L25.141 13H23v-.943l9.915-6.942C32.62 5.046 32.316 5 32 5h-.663L23 10.837V5h-2v10h15v-2h-5.629L36 9.059V9zM13 5v5.837L4.664 5H4c-1.118 0-2.126.461-2.852 1.2l9.711 6.8H7.372L.157 7.949C.065 8.286 0 8.634 0 9v.059L5.628 13H0v2h15V5h-2z"/><path fill="#CF1B2B" d="M21 15V5h-6v10H0v6h15v10h6V21h15v-6z"/></svg>
|
|
Before Width: | Height: | Size: 1.2 KiB |
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#1EB53A" d="M4 5C1.791 5 0 6.791 0 9v15.627L26.456 5H4z"/><path fill="#00A3DD" d="M32 31c2.209 0 4-1.791 4-4V11.33L9.479 31H32z"/><path fill="#141414" d="M32 5h-2.532L0 26.638V27c0 2.209 1.791 4 4 4h2.467L36 9.318V9c0-2.209-1.791-4-4-4z"/><path fill="#FBD035" d="M26.456 5L0 24.627v2.011L29.468 5zM9.479 31L36 11.33V9.318L6.467 31z"/></svg>
|
|
Before Width: | Height: | Size: 413 B |
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,3 @@
|
||||||
---
|
|
||||||
output: html_fragment
|
|
||||||
---
|
|
||||||
|
|
||||||
# Welcome <img src="FreesearchR-logo.png" style="float: right;"/>
|
# Welcome <img src="FreesearchR-logo.png" style="float: right;"/>
|
||||||
|
|
||||||
This is the ***FreesearchR*** data analysis tool, a free tool for basic data evaluation and analysis. If you need more advanced tools, start with ***FreesearchR*** and then you'll probably be better off using *R* or similar directly.
|
This is the ***FreesearchR*** data analysis tool, a free tool for basic data evaluation and analysis. If you need more advanced tools, start with ***FreesearchR*** and then you'll probably be better off using *R* or similar directly.
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,23 +0,0 @@
|
||||||
---
|
|
||||||
output: html_fragment
|
|
||||||
---
|
|
||||||
|
|
||||||
# Velkommen <img src="FreesearchR-logo.png" style="float: right;"/>
|
|
||||||
|
|
||||||
Dette er ***FreesearchR***-værktøjet, et gratis værktøj til databehandling og -analyse. Har du brug for mere avancerede værktøjer, så kan du starte ***FreesearchR*** og senere selv hente *R* og *RStudio* eller lignende.
|
|
||||||
|
|
||||||
Herunder kan du helt kort se, hvad du kan bruge ***FreesearchR*** til:
|
|
||||||
|
|
||||||
1. **Import data** from a spreadsheet/file on your machine, directly from a [REDCap](https://projectredcap.org/ "Read more on the data capture tool REDCap") server, try it with sample data or access data directly [if run in R locally](https://agdamsbo.github.io/FreesearchR//#run-locally-on-your-own-machine "Read about running FreesearchR on your local machine")
|
|
||||||
|
|
||||||
2. **Prepare** data for analysis by filtering data, modifying variables or create new variables
|
|
||||||
|
|
||||||
3. **Evaluate data** using descriptive analyses methods and inspect cross-correlations as well as [missing observations](https://agdamsbo.github.io/FreesearchR/articles/missingness.html "Read more about missing data")
|
|
||||||
|
|
||||||
4. **Visualise data** by [creating simple, clean plots](https://agdamsbo.github.io/FreesearchR/articles/visuals.html "See available plot types") for overview and quick insights
|
|
||||||
|
|
||||||
5. **Create simple regression models** for even more advanced data analyses
|
|
||||||
|
|
||||||
6. **Download** results as a report, get the modified data set and save the code for learning and to reproduce the results later
|
|
||||||
|
|
||||||
The full [project documentation is here](https://agdamsbo.github.io/FreesearchR/) where you'll find detailed descriptions of the app and link to the source code! If you want to [share feedback, please follow this link to a simple survey](https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8).
|
|
File diff suppressed because one or more lines are too long
|
@ -1,23 +0,0 @@
|
||||||
---
|
|
||||||
output: html_fragment
|
|
||||||
---
|
|
||||||
|
|
||||||
# Karibu <img src="FreesearchR-logo.png" style="float: right;"/>
|
|
||||||
|
|
||||||
This is the ***FreesearchR*** data analysis tool, a free tool for basic data evaluation and analysis. If you need more advanced tools, start with ***FreesearchR*** and then you'll probably be better off using *R* or similar directly.
|
|
||||||
|
|
||||||
With this tool you can:
|
|
||||||
|
|
||||||
1. **Import data** from a spreadsheet/file on your machine, directly from a [REDCap](https://projectredcap.org/ "Read more on the data capture tool REDCap") server, try it with sample data or access data directly [if run in R locally](https://agdamsbo.github.io/FreesearchR//#run-locally-on-your-own-machine "Read about running FreesearchR on your local machine")
|
|
||||||
|
|
||||||
2. **Prepare** data for analysis by filtering data, modifying variables or create new variables
|
|
||||||
|
|
||||||
3. **Evaluate data** using descriptive analyses methods and inspect cross-correlations as well as [missing observations](https://agdamsbo.github.io/FreesearchR/articles/missingness.html "Read more about missing data")
|
|
||||||
|
|
||||||
4. **Visualise data** by [creating simple, clean plots](https://agdamsbo.github.io/FreesearchR/articles/visuals.html "See available plot types") for overview and quick insights
|
|
||||||
|
|
||||||
5. **Create simple regression models** for even more advanced data analyses
|
|
||||||
|
|
||||||
6. **Download** results as a report, get the modified data set and save the code for learning and to reproduce the results later
|
|
||||||
|
|
||||||
The full [project documentation is here](https://agdamsbo.github.io/FreesearchR/) where you'll find detailed descriptions of the app and link to the source code! If you want to [share feedback, please follow this link to a simple survey](https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8).
|
|
|
@ -1,13 +1,5 @@
|
||||||
// Automatically close drop-downs on navigation
|
// Automatically close drop-downs on navigation
|
||||||
// Thanks to claude.ai
|
// Thanks to claude.ai
|
||||||
$(document).ready(function() {
|
|
||||||
var language = window.navigator.userLanguage || window.navigator.language;
|
|
||||||
var iso639Language = language.split('-')[0];
|
|
||||||
Shiny.onInputChange('browser_lang', iso639Language);
|
|
||||||
console.log('Browser language:',iso639Language);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$(document).on('shown.bs.tab', '#main_panel', function(e) {
|
$(document).on('shown.bs.tab', '#main_panel', function(e) {
|
||||||
// Close dropdown in this specific navset only
|
// Close dropdown in this specific navset only
|
||||||
$('#main_panel .dropdown-menu').removeClass('show');
|
$('#main_panel .dropdown-menu').removeClass('show');
|
||||||
|
@ -16,12 +8,6 @@ $(document).on('shown.bs.tab', '#main_panel', function(e) {
|
||||||
|
|
||||||
|
|
||||||
$(document).on('shiny:sessioninitialized', function() {
|
$(document).on('shiny:sessioninitialized', function() {
|
||||||
// Function to get browser language
|
|
||||||
// var language = window.navigator.userLanguage || window.navigator.language;
|
|
||||||
// var iso639Language = language.split('-')[0];
|
|
||||||
// Shiny.onInputChange('browser_lang', iso639Language);
|
|
||||||
// console.log('Browser language:',iso639Language);
|
|
||||||
|
|
||||||
// Function to collapse navbar on mobile
|
// Function to collapse navbar on mobile
|
||||||
function collapseNavbar() {
|
function collapseNavbar() {
|
||||||
var navbar = $('.navbar-collapse');
|
var navbar = $('.navbar-collapse');
|
||||||
|
@ -68,7 +54,4 @@ $(document).on('shiny:sessioninitialized', function() {
|
||||||
collapseNavbar();
|
collapseNavbar();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -123,5 +123,3 @@
|
||||||
background-color: #2E2E2E;
|
background-color: #2E2E2E;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,5 +123,3 @@
|
||||||
background-color: #2E2E2E;
|
background-color: #2E2E2E;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
// Automatically close drop-downs on navigation
|
// Automatically close drop-downs on navigation
|
||||||
// Thanks to claude.ai
|
// Thanks to claude.ai
|
||||||
$(document).ready(function() {
|
|
||||||
var language = window.navigator.userLanguage || window.navigator.language;
|
|
||||||
var iso639Language = language.split('-')[0];
|
|
||||||
Shiny.onInputChange('browser_lang', iso639Language);
|
|
||||||
console.log('Browser language:',iso639Language);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$(document).on('shown.bs.tab', '#main_panel', function(e) {
|
$(document).on('shown.bs.tab', '#main_panel', function(e) {
|
||||||
// Close dropdown in this specific navset only
|
// Close dropdown in this specific navset only
|
||||||
$('#main_panel .dropdown-menu').removeClass('show');
|
$('#main_panel .dropdown-menu').removeClass('show');
|
||||||
|
@ -16,12 +8,6 @@ $(document).on('shown.bs.tab', '#main_panel', function(e) {
|
||||||
|
|
||||||
|
|
||||||
$(document).on('shiny:sessioninitialized', function() {
|
$(document).on('shiny:sessioninitialized', function() {
|
||||||
// Function to get browser language
|
|
||||||
// var language = window.navigator.userLanguage || window.navigator.language;
|
|
||||||
// var iso639Language = language.split('-')[0];
|
|
||||||
// Shiny.onInputChange('browser_lang', iso639Language);
|
|
||||||
// console.log('Browser language:',iso639Language);
|
|
||||||
|
|
||||||
// Function to collapse navbar on mobile
|
// Function to collapse navbar on mobile
|
||||||
function collapseNavbar() {
|
function collapseNavbar() {
|
||||||
var navbar = $('.navbar-collapse');
|
var navbar = $('.navbar-collapse');
|
||||||
|
@ -68,7 +54,4 @@ $(document).on('shiny:sessioninitialized', function() {
|
||||||
collapseNavbar();
|
collapseNavbar();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,110 +0,0 @@
|
||||||
"en","da"
|
|
||||||
"Hello","Hej"
|
|
||||||
"Get started","Kom i gang"
|
|
||||||
"File upload","Upload fil"
|
|
||||||
"REDCap server export","REDCap server export"
|
|
||||||
"Local or sample data","Lokal eller testdata"
|
|
||||||
"Please be mindfull handling sensitive data","Pas godt på og overvej nøje hvordan du håndterer personfølsomme data"
|
|
||||||
"The ***FreesearchR*** app only stores data for analyses, but please only use with sensitive data when running locally. [Read more here](https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine).","***FreesearchR*** opbevarer alene data i forbindelse med din analyse, men du bør kun behandle personfølsomme data når du kører ***FreesearchR*** direkte på din egen maskine. [Læs mere her](https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine)."
|
|
||||||
"Quick overview","Hurtigt overblik"
|
|
||||||
"Select variables for final import","Vælg variabler til den endelige import"
|
|
||||||
"Exclude incomplete variables:","Ekskluder inkomplette variabler:"
|
|
||||||
"Manual selection:","Manuel udvælgelse:"
|
|
||||||
"Let's begin!","Kom i gang!"
|
|
||||||
"Analysis validation","Analysevalidering"
|
|
||||||
"Report","Rapport"
|
|
||||||
"Choose your favourite output file format for further work, and download, when the analyses are done.","Vælge dit foretrukne dataformat, og hent data, når du er ærdig med databehandlingen."
|
|
||||||
"www/intro.html","www/intro_da.html"
|
|
||||||
"<p>The <em><strong>FreesearchR</strong></em> app only stores data for analyses, but please only use with sensitive data when running locally. <a href='https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine'>Read more here</a></p>","<p><em><strong>FreesearchR</strong></em> opbevarer alene data i forbindelse med din analyse, men du bør kun behandle personfølsomme data når du kører <em><strong>FreesearchR</strong></em> direkte på dine egen maskine. <a href='https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine'>Læs mere her</a></p>"
|
|
||||||
"Overview and filter","Overblik og filtre"
|
|
||||||
"Overview and filtering","Overblik og filtrering"
|
|
||||||
"Below you find a summary table for quick insigths, and on the right you can visualise data classes, browse data and apply different data filters.","Below you find a summary table for quick insigths, and on the right you can visualise data classes, browse data and apply different data filters."
|
|
||||||
"Visual overview","Visuelt overblik"
|
|
||||||
"Browse data","Udforsk data"
|
|
||||||
"Filter data types","Filtrer datatyper"
|
|
||||||
"Filter observations","Filtrer observationer"
|
|
||||||
"Apply filter on observation","Anvend filtre af observationer"
|
|
||||||
"Edit and create data","Ændr og opret variabler"
|
|
||||||
"Subset, rename and convert variables","Udvælg, omdøb og konverter variabler"
|
|
||||||
"Below, are several options for simple data manipulation like update variables by renaming, creating new labels (for nicer tables in the report) and changing variable classes (numeric, factor/categorical etc.).","Below, are several options for simple data manipulation like update variables by renaming, creating new labels (for nicer tables in the report) and changing variable classes (numeric, factor/categorical etc.)."
|
|
||||||
"There are more advanced options to modify factor/categorical variables as well as create new factor from a continous 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 a continous variable or new variables with R code. At the bottom you can restore the original data."
|
|
||||||
"Please note that data modifications are applied before any filtering.","Please note that data modifications are applied before any filtering."
|
|
||||||
"Advanced data manipulation","Avanceret datamanipulation"
|
|
||||||
"Below options allow more advanced varaible manipulations.","Below options allow more advanced varaible manipulations."
|
|
||||||
"Reorder factor levels","Arranger niveuer i faktor"
|
|
||||||
"Reorder the levels of factor/categorical variables.","Reorder the levels of factor/categorical variables."
|
|
||||||
"New factor","Ny faktor"
|
|
||||||
"Create factor/categorical variable from a continous variable (number/date/time).","Create factor/categorical variable from a continous variable (number/date/time)."
|
|
||||||
"New variable","Ny variabel"
|
|
||||||
"Create a new variable based on an R-expression.","Create a new variable based on an R-expression."
|
|
||||||
"Compare modified data to original","Compare modified data to original"
|
|
||||||
"Raw print of the original vs the modified data.","Raw print of the original vs the modified data."
|
|
||||||
"Original data:","Original data:"
|
|
||||||
"Modified data:","Ændret data:"
|
|
||||||
"New column name:","Navn til ny variabel:"
|
|
||||||
"Group calculation by:","Group calculation by:"
|
|
||||||
"Enter an expression to define new column:","Enter an expression to define new column:"
|
|
||||||
"Click on a column name to add it to the expression:","Click on a column name to add it to the expression:"
|
|
||||||
"Create column","Create column"
|
|
||||||
"Choose a name for the column to be created or modified,","Choose a name for the column to be created or modified,"
|
|
||||||
"then enter an expression before clicking on the button above to validate or on","then enter an expression before clicking on the button above to validate or on"
|
|
||||||
"to delete it.","to delete it."
|
|
||||||
"New column name cannot be empty","New column name cannot be empty"
|
|
||||||
"Create a new column","Create a new column"
|
|
||||||
"Some operations are not allowed","Some operations are not allowed"
|
|
||||||
"Column added!","Column added!"
|
|
||||||
"Unique values:","Unique values:"
|
|
||||||
"Variable to cut:","Variable to cut:"
|
|
||||||
"Number of breaks:","Number of breaks:"
|
|
||||||
"Close intervals on the right","Close intervals on the right"
|
|
||||||
"Include lowest value","Include lowest value"
|
|
||||||
"Create factor variable","Create factor variable"
|
|
||||||
"Fixed breaks:","Fixed breaks:"
|
|
||||||
"Method:","Method:"
|
|
||||||
"Convert Numeric to Factor","Convert Numeric to Factor"
|
|
||||||
"Unique:","Unique:"
|
|
||||||
"Missing:","Missing:"
|
|
||||||
"Most Common:","Most Common:"
|
|
||||||
"Min:","Min:"
|
|
||||||
"Mean:","Mean:"
|
|
||||||
"Max:","Max:"
|
|
||||||
"Decimal separator:","Decimal separator:"
|
|
||||||
"First five rows are shown below:","First five rows are shown below:"
|
|
||||||
"Imported data","Imported data"
|
|
||||||
"www/intro.md","www/intro.md"
|
|
||||||
"Choose your data","Choose your data"
|
|
||||||
"Upload a file, get data directly from REDCap or use local or sample data.","Upload a file, get data directly from REDCap or use local or sample data."
|
|
||||||
"Factor variable to reorder:","Factor variable to reorder:"
|
|
||||||
"Sort by levels","Sort by levels"
|
|
||||||
"Sort by count","Sort by count"
|
|
||||||
"Create a new variable (otherwise replaces the one selected)","Create a new variable (otherwise replaces the one selected)"
|
|
||||||
"Update factor variable","Updater faktor-variabel"
|
|
||||||
"Sort count","Sorter antal"
|
|
||||||
"Levels","Niveauer"
|
|
||||||
"Count","Antal"
|
|
||||||
"Update levels of a factor","Updater niveauerne for en faktor"
|
|
||||||
"Update & select variables","Update & select variables"
|
|
||||||
"Date format:","Datoformat:"
|
|
||||||
"Date to use as origin to convert date/datetime:","Date to use as origin to convert date/datetime:"
|
|
||||||
"Apply changes","Apply changes"
|
|
||||||
"No data to display.","Ingen data at vise."
|
|
||||||
"Data successfully updated!","Data er opdateret!"
|
|
||||||
"You removed {p_out} % of observations.","Du har fjernet {p_out} % af observationerne."
|
|
||||||
"You removed {p_out} % of variables.","Du har fjernet {p_out} % af variablerne."
|
|
||||||
"You can import {file_extensions_text} files","Du kan vælge mellem disse filtyper: {file_extensions_text}."
|
|
||||||
"You can choose between these file types:","Du kan vælge mellem følgene filtyper:"
|
|
||||||
"Rows to skip before reading data:","Rækker der skal springes over:"
|
|
||||||
"Missing values character(s):","Tegn for manglende værdier:"
|
|
||||||
"if several use a comma (',') to separate them","if several use a comma (',') to separate them"
|
|
||||||
"Encoding:","Kodning:"
|
|
||||||
"Upload a file:","Upload en fil:"
|
|
||||||
"Browse...","Vælg..."
|
|
||||||
"Select sheet to import:","Vælg ark:"
|
|
||||||
"No file selected.","Ingen fil valgt."
|
|
||||||
"Evaluate","Evaluer"
|
|
||||||
"Visuals","Grafik"
|
|
||||||
"Regression","Regression"
|
|
||||||
"Download","Download"
|
|
||||||
"{data_text} has {n} observations and {n_var} variables, with {n_complete} ({p_complete} %) complete cases.","{data_text} har {n} observationer og {n_var} variabler, med {n_complete} ({p_complete} %) komplette cases."
|
|
||||||
"Prepare","Forbered"
|
|
||||||
"At 0, only complete variables are included; at 100, all variables are included.","At 0, only complete variables are included; at 100, all variables are included."
|
|
|
|
@ -1,110 +0,0 @@
|
||||||
"en","sw"
|
|
||||||
"Hello","Habari"
|
|
||||||
"Get started","Get started"
|
|
||||||
"File upload","File upload"
|
|
||||||
"REDCap server export","REDCap server export"
|
|
||||||
"Local or sample data","Local or sample data"
|
|
||||||
"Please be mindfull handling sensitive data","Please be mindfull handling sensitive data"
|
|
||||||
"The ***FreesearchR*** app only stores data for analyses, but please only use with sensitive data when running locally. [Read more here](https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine).","The ***FreesearchR*** app only stores data for analyses, but please only use with sensitive data when running locally. [Read more here](https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine)."
|
|
||||||
"Quick overview","Quick overview"
|
|
||||||
"Select variables for final import","Select variables for final import"
|
|
||||||
"Exclude incomplete variables:","Exclude incomplete variables:"
|
|
||||||
"Manual selection:","Manual selection:"
|
|
||||||
"Let's begin!","Let's begin!"
|
|
||||||
"Analysis validation","Analysis validation"
|
|
||||||
"Report","Report"
|
|
||||||
"Choose your favourite output file format for further work, and download, when the analyses are done.","Choose your favourite output file format for further work, and download, when the analyses are done."
|
|
||||||
"www/intro.html","www/intro_sw.html"
|
|
||||||
"<p>The <em><strong>FreesearchR</strong></em> app only stores data for analyses, but please only use with sensitive data when running locally. <a href='https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine'>Read more here</a></p>","<p>The <em><strong>FreesearchR</strong></em> app only stores data for analyses, but please only use with sensitive data when running locally. <a href='https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine'>Read more here</a></p>"
|
|
||||||
"Overview and filter","Overview and filter"
|
|
||||||
"Overview and filtering","Overview and filtering"
|
|
||||||
"Below you find a summary table for quick insigths, and on the right you can visualise data classes, browse data and apply different data filters.","Below you find a summary table for quick insigths, and on the right you can visualise data classes, browse data and apply different data filters."
|
|
||||||
"Visual overview","Visual overview"
|
|
||||||
"Browse data","Browse data"
|
|
||||||
"Filter data types","Filter data types"
|
|
||||||
"Filter observations","Filter observations"
|
|
||||||
"Apply filter on observation","Apply filter on observation"
|
|
||||||
"Edit and create data","Edit and create data"
|
|
||||||
"Subset, rename and convert variables","Subset, rename and convert variables"
|
|
||||||
"Below, are several options for simple data manipulation like update variables by renaming, creating new labels (for nicer tables in the report) and changing variable classes (numeric, factor/categorical etc.).","Below, are several options for simple data manipulation like update variables by renaming, creating new labels (for nicer tables in the report) and changing variable classes (numeric, factor/categorical etc.)."
|
|
||||||
"There are more advanced options to modify factor/categorical variables as well as create new factor from a continous 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 a continous variable or new variables with R code. At the bottom you can restore the original data."
|
|
||||||
"Please note that data modifications are applied before any filtering.","Please note that data modifications are applied before any filtering."
|
|
||||||
"Advanced data manipulation","Advanced data manipulation"
|
|
||||||
"Below options allow more advanced varaible manipulations.","Below options allow more advanced varaible manipulations."
|
|
||||||
"Reorder factor levels","Reorder factor levels"
|
|
||||||
"Reorder the levels of factor/categorical variables.","Reorder the levels of factor/categorical variables."
|
|
||||||
"New factor","New factor"
|
|
||||||
"Create factor/categorical variable from a continous variable (number/date/time).","Create factor/categorical variable from a continous variable (number/date/time)."
|
|
||||||
"New variable","New variable"
|
|
||||||
"Create a new variable based on an R-expression.","Create a new variable based on an R-expression."
|
|
||||||
"Compare modified data to original","Compare modified data to original"
|
|
||||||
"Raw print of the original vs the modified data.","Raw print of the original vs the modified data."
|
|
||||||
"Original data:","Original data:"
|
|
||||||
"Modified data:","Modified data:"
|
|
||||||
"New column name:","New column name:"
|
|
||||||
"Group calculation by:","Group calculation by:"
|
|
||||||
"Enter an expression to define new column:","Enter an expression to define new column:"
|
|
||||||
"Click on a column name to add it to the expression:","Click on a column name to add it to the expression:"
|
|
||||||
"Create column","Create column"
|
|
||||||
"Choose a name for the column to be created or modified,","Choose a name for the column to be created or modified,"
|
|
||||||
"then enter an expression before clicking on the button above to validate or on","then enter an expression before clicking on the button above to validate or on"
|
|
||||||
"to delete it.","to delete it."
|
|
||||||
"New column name cannot be empty","New column name cannot be empty"
|
|
||||||
"Create a new column","Create a new column"
|
|
||||||
"Some operations are not allowed","Some operations are not allowed"
|
|
||||||
"Column added!","Column added!"
|
|
||||||
"Unique values:","Unique values:"
|
|
||||||
"Variable to cut:","Variable to cut:"
|
|
||||||
"Number of breaks:","Number of breaks:"
|
|
||||||
"Close intervals on the right","Close intervals on the right"
|
|
||||||
"Include lowest value","Include lowest value"
|
|
||||||
"Create factor variable","Create factor variable"
|
|
||||||
"Fixed breaks:","Fixed breaks:"
|
|
||||||
"Method:","Method:"
|
|
||||||
"Convert Numeric to Factor","Convert Numeric to Factor"
|
|
||||||
"Unique:","Unique:"
|
|
||||||
"Missing:","Missing:"
|
|
||||||
"Most Common:","Most Common:"
|
|
||||||
"Min:","Min:"
|
|
||||||
"Mean:","Mean:"
|
|
||||||
"Max:","Max:"
|
|
||||||
"Decimal separator:","Decimal separator:"
|
|
||||||
"First five rows are shown below:","First five rows are shown below:"
|
|
||||||
"Imported data","Imported data"
|
|
||||||
"www/intro.md","www/intro.md"
|
|
||||||
"Choose your data","Choose your data"
|
|
||||||
"Upload a file, get data directly from REDCap or use local or sample data.","Upload a file, get data directly from REDCap or use local or sample data."
|
|
||||||
"Factor variable to reorder:","Factor variable to reorder:"
|
|
||||||
"Sort by levels","Sort by levels"
|
|
||||||
"Sort by count","Sort by count"
|
|
||||||
"Create a new variable (otherwise replaces the one selected)","Create a new variable (otherwise replaces the one selected)"
|
|
||||||
"Update factor variable","Update factor variable"
|
|
||||||
"Sort count","Sort count"
|
|
||||||
"Levels","Levels"
|
|
||||||
"Count","Count"
|
|
||||||
"Update levels of a factor","Update levels of a factor"
|
|
||||||
"Update & select variables","Update & select variables"
|
|
||||||
"Date format:","Date format:"
|
|
||||||
"Date to use as origin to convert date/datetime:","Date to use as origin to convert date/datetime:"
|
|
||||||
"Apply changes","Apply changes"
|
|
||||||
"No data to display.","No data to display."
|
|
||||||
"Data successfully updated!","Data successfully updated!"
|
|
||||||
"You removed {p_out} % of observations.","You removed {p_out} % of observations."
|
|
||||||
"You removed {p_out} % of variables.","You removed {p_out} % of variables."
|
|
||||||
"You can import {file_extensions_text} files","You can import {file_extensions_text} files"
|
|
||||||
"You can choose between these file types:","You can choose between these file types:"
|
|
||||||
"Rows to skip before reading data:","Rows to skip before reading data:"
|
|
||||||
"Missing values character(s):","Missing values character(s):"
|
|
||||||
"if several use a comma (',') to separate them","if several use a comma (',') to separate them"
|
|
||||||
"Encoding:","Encoding:"
|
|
||||||
"Upload a file:","Upload a file:"
|
|
||||||
"Browse...","Browse..."
|
|
||||||
"Select sheet to import:","Select sheet to import:"
|
|
||||||
"No file selected.","No file selected."
|
|
||||||
"Evaluate","Evaluate"
|
|
||||||
"Visuals","Visuals"
|
|
||||||
"Regression","Regression"
|
|
||||||
"Download","Download"
|
|
||||||
"{data_text} has {n} observations and {n_var} variables, with {n_complete} ({p_complete} %) complete cases.","{data_text} has {n} observations and {n_var} variables, with {n_complete} ({p_complete} %) complete cases."
|
|
||||||
"Prepare","Prepare"
|
|
||||||
"At 0, only complete variables are included; at 100, all variables are included.","At 0, only complete variables are included; at 100, all variables are included."
|
|
|
|
@ -21,7 +21,7 @@ list_allowed_operations()
|
||||||
|
|
||||||
modal_create_column(
|
modal_create_column(
|
||||||
id,
|
id,
|
||||||
title = i18n$t("Create a new column"),
|
title = i18n("Create a new column"),
|
||||||
easyClose = TRUE,
|
easyClose = TRUE,
|
||||||
size = "l",
|
size = "l",
|
||||||
footer = NULL
|
footer = NULL
|
||||||
|
@ -29,7 +29,7 @@ modal_create_column(
|
||||||
|
|
||||||
winbox_create_column(
|
winbox_create_column(
|
||||||
id,
|
id,
|
||||||
title = i18n$t("Create a new column"),
|
title = i18n("Create a new column"),
|
||||||
options = shinyWidgets::wbOptions(),
|
options = shinyWidgets::wbOptions(),
|
||||||
controls = shinyWidgets::wbControls()
|
controls = shinyWidgets::wbControls()
|
||||||
)
|
)
|
||||||
|
|
|
@ -13,7 +13,7 @@ cut_variable_server(id, data_r = reactive(NULL))
|
||||||
|
|
||||||
modal_cut_variable(
|
modal_cut_variable(
|
||||||
id,
|
id,
|
||||||
title = i18n$t("Convert Numeric to Factor"),
|
title = datamods:::i18n("Convert Numeric to Factor"),
|
||||||
easyClose = TRUE,
|
easyClose = TRUE,
|
||||||
size = "l",
|
size = "l",
|
||||||
footer = NULL
|
footer = NULL
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{dim_change_call}
|
|
||||||
\alias{dim_change_call}
|
|
||||||
\title{Dimensions validation}
|
|
||||||
\usage{
|
|
||||||
dim_change_call(before, after, fun)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{before}{data before}
|
|
||||||
|
|
||||||
\item{after}{data after}
|
|
||||||
|
|
||||||
\item{fun}{dimension function. ncol or nrow}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
data.frame
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Dimensions validation
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{make_validation}
|
|
||||||
\alias{make_validation}
|
|
||||||
\title{Create validation data.frame}
|
|
||||||
\usage{
|
|
||||||
make_validation(ls, ...)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{ls}{validation list}
|
|
||||||
|
|
||||||
\item{...}{magic dots}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
data.frame
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Create validation data.frame
|
|
||||||
}
|
|
||||||
\examples{
|
|
||||||
i18n <- shiny.i18n::Translator$new(translation_csvs_path = here::here("inst/translations"))
|
|
||||||
i18n$set_translation_language("en")
|
|
||||||
df_original <- mtcars
|
|
||||||
df_original[1,2:4] <- NA
|
|
||||||
df_obs <- df_original |> dplyr::filter(carb==4)
|
|
||||||
df_vars <- df_original[1:7]
|
|
||||||
val <- purrr::map2(
|
|
||||||
.x = validation_lib(),
|
|
||||||
.y = list(
|
|
||||||
list(x = df_original, y = df_obs),
|
|
||||||
list(x = df_original, y = df_vars),
|
|
||||||
list(x=df_original)),
|
|
||||||
make_validation
|
|
||||||
)
|
|
||||||
val |> make_validation_alerts()
|
|
||||||
|
|
||||||
val2 <- purrr::map2(
|
|
||||||
.x = validation_lib()[2],
|
|
||||||
.y = list(list(x = mtcars, y = mtcars[0])),
|
|
||||||
make_validation
|
|
||||||
)
|
|
||||||
val2 |> make_validation_alerts()
|
|
||||||
|
|
||||||
val3 <- make_validation(
|
|
||||||
ls = validation_lib()[[2]],
|
|
||||||
list(x = mtcars, y = mtcars[0])
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{make_validation_alerts}
|
|
||||||
\alias{make_validation_alerts}
|
|
||||||
\title{Create alert from validation data.frame}
|
|
||||||
\usage{
|
|
||||||
make_validation_alerts(data)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{data}{}
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Create alert from validation data.frame
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{missings_validate}
|
|
||||||
\alias{missings_validate}
|
|
||||||
\title{Validate function of missingness in data}
|
|
||||||
\usage{
|
|
||||||
missings_validate(data)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{data}{data set}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
data.frame
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Validate function of missingness in data
|
|
||||||
}
|
|
||||||
\examples{
|
|
||||||
df <- mtcars
|
|
||||||
df[1,2:4] <- NA
|
|
||||||
missings_validate(df)
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{obs_filter_validate}
|
|
||||||
\alias{obs_filter_validate}
|
|
||||||
\title{Observations filter test wrapper}
|
|
||||||
\usage{
|
|
||||||
obs_filter_validate(before, after)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{before}{data before}
|
|
||||||
|
|
||||||
\item{after}{data after}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
vector
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Observations filter test wrapper
|
|
||||||
}
|
|
|
@ -14,7 +14,7 @@ update_factor_server(id, data_r = reactive(NULL))
|
||||||
|
|
||||||
modal_update_factor(
|
modal_update_factor(
|
||||||
id,
|
id,
|
||||||
title = i18n$t("Update levels of a factor"),
|
title = i18n("Update levels of a factor"),
|
||||||
easyClose = TRUE,
|
easyClose = TRUE,
|
||||||
size = "l",
|
size = "l",
|
||||||
footer = NULL
|
footer = NULL
|
||||||
|
@ -22,7 +22,7 @@ modal_update_factor(
|
||||||
|
|
||||||
winbox_update_factor(
|
winbox_update_factor(
|
||||||
id,
|
id,
|
||||||
title = i18n$t("Update levels of a factor"),
|
title = i18n("Update levels of a factor"),
|
||||||
options = shinyWidgets::wbOptions(),
|
options = shinyWidgets::wbOptions(),
|
||||||
controls = shinyWidgets::wbControls()
|
controls = shinyWidgets::wbControls()
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,169 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{validation_ui}
|
|
||||||
\alias{validation_ui}
|
|
||||||
\alias{validation_server}
|
|
||||||
\title{Validation module}
|
|
||||||
\usage{
|
|
||||||
validation_ui(id, max_height = NULL, ...)
|
|
||||||
|
|
||||||
validation_server(id, data)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{id}{Module's ID.}
|
|
||||||
|
|
||||||
\item{max_height}{Maximum height for validation results element, useful if you have many rules.}
|
|
||||||
|
|
||||||
\item{...}{Arguments passed to \code{actionButton} or \code{uiOutput} depending on display mode,
|
|
||||||
you cannot use \code{inputId}/\code{outputId}, \code{label} or \code{icon} (button only).}
|
|
||||||
|
|
||||||
\item{data}{a \code{reactive} function returning a \code{data.frame}.}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
\itemize{
|
|
||||||
\item UI: HTML tags that can be included in shiny's UI
|
|
||||||
\item Server: a \code{list} with two slots:
|
|
||||||
\itemize{
|
|
||||||
\item \strong{status}: a \code{reactive} function returning the best status available between \code{"OK"}, \code{"Failed"} or \code{"Error"}.
|
|
||||||
\item \strong{details}: a \code{reactive} function returning a \code{list} with validation details.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Check that a dataset respect some validation expectations.
|
|
||||||
}
|
|
||||||
\examples{
|
|
||||||
#' Data and analyses validation demo
|
|
||||||
#'
|
|
||||||
#' @returns
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' \dontrun{
|
|
||||||
#' validation_demo_app()
|
|
||||||
#' }
|
|
||||||
validation_demo_app <- function() {
|
|
||||||
ui <- shiny::fluidPage(
|
|
||||||
shiny::tags$h2("Validation"),
|
|
||||||
IDEAFilter::IDEAFilter_ui("data_filter"),
|
|
||||||
shiny::br(),
|
|
||||||
DT::DTOutput("data_final"),
|
|
||||||
shiny::br(),
|
|
||||||
validation_ui("validation_demo_2")
|
|
||||||
)
|
|
||||||
|
|
||||||
server <- function(input, output, session) {
|
|
||||||
rv <- shiny::reactiveValues(
|
|
||||||
data_original = shiny::reactive(mtcars),
|
|
||||||
data_filtered = NULL
|
|
||||||
)
|
|
||||||
|
|
||||||
rv_validation <- shiny::reactiveValues(
|
|
||||||
obs_filter = NULL,
|
|
||||||
vars_filter = NULL
|
|
||||||
)
|
|
||||||
|
|
||||||
data_filter <- IDEAFilter::IDEAFilter(
|
|
||||||
id = "data_filter",
|
|
||||||
data = mtcars,
|
|
||||||
verbose = TRUE
|
|
||||||
)
|
|
||||||
|
|
||||||
shiny::observeEvent(
|
|
||||||
data_filter(),
|
|
||||||
{
|
|
||||||
rv$data_filtered <- data_filter()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
output$data_final <- DT::renderDT(
|
|
||||||
data_filter()
|
|
||||||
)
|
|
||||||
|
|
||||||
shiny::observeEvent(
|
|
||||||
list(
|
|
||||||
data_filter()
|
|
||||||
),
|
|
||||||
{
|
|
||||||
to_make_validation <- data_filter()
|
|
||||||
## Validation
|
|
||||||
if (!is.null(to_make_validation)) {
|
|
||||||
validation <-
|
|
||||||
make_validation(
|
|
||||||
ls = validation_lib("obs_filter"),
|
|
||||||
list(
|
|
||||||
x = mtcars,
|
|
||||||
y = to_make_validation
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
rv_validation$vars_filter <- validation
|
|
||||||
|
|
||||||
validation_server(id = "validation_demo_2", data = rv_validation$vars_filter)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
# shiny::observeEvent(
|
|
||||||
# list(
|
|
||||||
# shiny::reactive(rv_validation$vars_filter)(),
|
|
||||||
# data_filter()
|
|
||||||
# ),
|
|
||||||
# {
|
|
||||||
# # browser()
|
|
||||||
# # to_make_alert <- shiny::isolate(rv_validation$vars_filter)
|
|
||||||
# to_make_alert <- shiny::reactive(rv_validation$vars_filter)()
|
|
||||||
# if (!is.null(rv_validation$vars_filter)) {
|
|
||||||
# validation_server(id = "validation_demo_2", data = to_make_alert)
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# )
|
|
||||||
}
|
|
||||||
shiny::shinyApp(ui, server)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#' Title
|
|
||||||
#'
|
|
||||||
#' @returns
|
|
||||||
#' @export
|
|
||||||
#'
|
|
||||||
#' @examples
|
|
||||||
#' validation_nr_demo_app()
|
|
||||||
validation_nr_demo_app <- function() {
|
|
||||||
ui <- shiny::fluidPage(
|
|
||||||
shiny::tags$h2("Validation"),
|
|
||||||
shiny::br(),
|
|
||||||
validation_ui("validation_demo_1", max_height = "30px"),
|
|
||||||
shiny::br(),
|
|
||||||
validation_ui("validation_demo_2")
|
|
||||||
)
|
|
||||||
|
|
||||||
server <- function(input, output, session) {
|
|
||||||
df_original <- mtcars
|
|
||||||
|
|
||||||
df_obs <- mtcars |> dplyr::filter(mpg > 20)
|
|
||||||
|
|
||||||
df_vars <- df_obs[1:6]
|
|
||||||
|
|
||||||
val1 <- purrr::map2(
|
|
||||||
.x = validation_lib()[1],
|
|
||||||
.y = list(list(x = df_original, y = df_obs)),
|
|
||||||
make_validation
|
|
||||||
)
|
|
||||||
|
|
||||||
val2 <- make_validation(
|
|
||||||
ls = validation_lib()[[2]],
|
|
||||||
list(x = df_original, y = df_vars)
|
|
||||||
)
|
|
||||||
|
|
||||||
validation_server(id = "validation_demo_1", data = val1)
|
|
||||||
|
|
||||||
validation_server(id = "validation_demo_2", data = val2)
|
|
||||||
}
|
|
||||||
shiny::shinyApp(ui, server)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{validation_lib}
|
|
||||||
\alias{validation_lib}
|
|
||||||
\title{Validation library}
|
|
||||||
\usage{
|
|
||||||
validation_lib(name = NULL)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{name}{Index name}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
list
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Validation library
|
|
||||||
}
|
|
||||||
\examples{
|
|
||||||
validation_lib()
|
|
||||||
validation_lib("missings")
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
% Generated by roxygen2: do not edit by hand
|
|
||||||
% Please edit documentation in R/validation.R
|
|
||||||
\name{vars_filter_validate}
|
|
||||||
\alias{vars_filter_validate}
|
|
||||||
\title{Variable filter test wrapper}
|
|
||||||
\usage{
|
|
||||||
vars_filter_validate(before, after)
|
|
||||||
}
|
|
||||||
\arguments{
|
|
||||||
\item{before}{data before}
|
|
||||||
|
|
||||||
\item{after}{data after}
|
|
||||||
}
|
|
||||||
\value{
|
|
||||||
vector
|
|
||||||
}
|
|
||||||
\description{
|
|
||||||
Variable filter test wrapper
|
|
||||||
}
|
|
||||||
\examples{
|
|
||||||
vars_filter_validate(mtcars, mtcars[1:6])
|
|
||||||
vars_filter_validate(mtcars, mtcars[0])
|
|
||||||
}
|
|
44
renv.lock
44
renv.lock
|
@ -8060,50 +8060,6 @@
|
||||||
"Maintainer": "Winston Chang <winston@posit.co>",
|
"Maintainer": "Winston Chang <winston@posit.co>",
|
||||||
"Repository": "CRAN"
|
"Repository": "CRAN"
|
||||||
},
|
},
|
||||||
"shiny.i18n": {
|
|
||||||
"Package": "shiny.i18n",
|
|
||||||
"Version": "0.3.0",
|
|
||||||
"Source": "Repository",
|
|
||||||
"Title": "Shiny Applications Internationalization",
|
|
||||||
"Authors@R": "c( person(\"Jakub\", \"Nowicki\", email = \"opensource+kuba@appsilon.com\", role = c(\"cre\", \"aut\")), person(\"Dominik\", \"Krzemiński\", email = \"raymon92@gmail.com\", role = c(\"aut\")), person(\"Krystian\", \"Igras\", email = \"krystian8207@gmail.com\", role = c(\"aut\")), person(\"Jakub\", \"Sobolewski\", email = \"jakub.sobolewski@appsilon.com\", role = c(\"aut\")), person(\"Appsilon Sp. z o.o.\", role = \"cph\", email = \"opensource@appsilon.com\") )",
|
|
||||||
"Description": "It provides easy internationalization of Shiny applications. It can be used as standalone translation package to translate reports, interactive visualizations or graphical elements as well.",
|
|
||||||
"Depends": [
|
|
||||||
"R (>= 3.3.0)"
|
|
||||||
],
|
|
||||||
"Imports": [
|
|
||||||
"yaml",
|
|
||||||
"jsonlite",
|
|
||||||
"methods",
|
|
||||||
"stringr",
|
|
||||||
"R6",
|
|
||||||
"glue",
|
|
||||||
"shiny",
|
|
||||||
"rstudioapi",
|
|
||||||
"utils"
|
|
||||||
],
|
|
||||||
"License": "MIT + file LICENSE",
|
|
||||||
"Encoding": "UTF-8",
|
|
||||||
"URL": "https://appsilon.github.io/shiny.i18n/, https://github.com/Appsilon/shiny.i18n",
|
|
||||||
"BugReports": "https://github.com/Appsilon/shiny.i18n/issues",
|
|
||||||
"RoxygenNote": "7.2.1",
|
|
||||||
"Suggests": [
|
|
||||||
"covr",
|
|
||||||
"googleLanguageR",
|
|
||||||
"knitr",
|
|
||||||
"lintr",
|
|
||||||
"rcmdcheck",
|
|
||||||
"rmarkdown",
|
|
||||||
"spelling",
|
|
||||||
"testthat",
|
|
||||||
"withr",
|
|
||||||
"quarto"
|
|
||||||
],
|
|
||||||
"Language": "en-US",
|
|
||||||
"NeedsCompilation": "no",
|
|
||||||
"Author": "Jakub Nowicki [cre, aut], Dominik Krzemiński [aut], Krystian Igras [aut], Jakub Sobolewski [aut], Appsilon Sp. z o.o. [cph]",
|
|
||||||
"Maintainer": "Jakub Nowicki <opensource+kuba@appsilon.com>",
|
|
||||||
"Repository": "CRAN"
|
|
||||||
},
|
|
||||||
"shinyTime": {
|
"shinyTime": {
|
||||||
"Package": "shinyTime",
|
"Package": "shinyTime",
|
||||||
"Version": "1.0.3",
|
"Version": "1.0.3",
|
||||||
|
|
Loading…
Add table
Reference in a new issue