mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
new version
This commit is contained in:
parent
fdc0bfed02
commit
fcc9443cea
20 changed files with 159 additions and 141 deletions
100
app_docker/app.R
100
app_docker/app.R
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
########
|
||||
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//Rtmpp0JgLn/file73e17b926733.R
|
||||
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpDLoQCo/file14ced11821c07.R
|
||||
########
|
||||
|
||||
i18n_path <- here::here("translations")
|
||||
|
|
@ -72,7 +72,7 @@ if (!"global_freesearchR" %in% ls(name = globalenv())) {
|
|||
#### Current file: /Users/au301842/FreesearchR/R//app_version.R
|
||||
########
|
||||
|
||||
app_version <- function()'26.2.2'
|
||||
app_version <- function()'26.3.1'
|
||||
|
||||
|
||||
########
|
||||
|
|
@ -4524,7 +4524,7 @@ data_types <- function() {
|
|||
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
|
||||
########
|
||||
|
||||
hosted_version <- function()'v26.2.2-260223'
|
||||
hosted_version <- function()'v26.3.1-260228'
|
||||
|
||||
|
||||
########
|
||||
|
|
@ -10469,9 +10469,21 @@ custom_theme <- function(...,
|
|||
primary = FreesearchR_colors("primary"),
|
||||
secondary = FreesearchR_colors("secondary"),
|
||||
bootswatch = "united",
|
||||
base_font = bslib::font_google("Montserrat"),
|
||||
heading_font = bslib::font_google("Public Sans", wght = "700"),
|
||||
code_font = bslib::font_google("Open Sans"),
|
||||
# base_font = bslib::font_google("Montserrat"),
|
||||
base_font = bslib::font_face(
|
||||
family = "Montserrat",
|
||||
src = "url('/fonts/Montserrat-Regular.ttf') format('truetype')"
|
||||
),
|
||||
# heading_font = bslib::font_google("Public Sans", wght = "700"),
|
||||
heading_font = bslib::font_face(
|
||||
family = "PublicSans",
|
||||
src = "url('/fonts/PublicSans-Bold.ttf') format('truetype')"
|
||||
),
|
||||
# code_font = bslib::font_google("Open Sans"),
|
||||
code_font = bslib::font_face(
|
||||
family = "OpenSans",
|
||||
src = "url('/fonts/OpenSans-Regular.ttf') format('truetype')"
|
||||
),
|
||||
success = FreesearchR_colors("success"),
|
||||
info = FreesearchR_colors("info"),
|
||||
warning = FreesearchR_colors("warning"),
|
||||
|
|
@ -10664,11 +10676,12 @@ ui_elements <- function(selection) {
|
|||
),
|
||||
# shiny::tags$script('document.querySelector("#source div").style.width = "100%"'),
|
||||
## Update this to change depending on run locally or hosted
|
||||
shiny::helpText(
|
||||
i18n$t(
|
||||
"Upload a file, get data directly from REDCap or use local or sample data."
|
||||
)
|
||||
),
|
||||
shiny::uiOutput(outputId = "data_sample_text"),
|
||||
# shiny::helpText(
|
||||
# i18n$t(
|
||||
# "Upload a file, get data directly from REDCap or use local or sample data."
|
||||
# )
|
||||
# ),
|
||||
shiny::br(),
|
||||
shiny::br(),
|
||||
shiny::conditionalPanel(
|
||||
|
|
@ -13496,16 +13509,6 @@ ui <- bslib::page_fixed(
|
|||
#### Current file: /Users/au301842/FreesearchR/app/server.R
|
||||
########
|
||||
|
||||
data("mtcars")
|
||||
data("iris")
|
||||
|
||||
# trial <- gtsummary::trial
|
||||
# starwars <- dplyr::starwars
|
||||
#
|
||||
# mtcars_na <- rbind(mtcars,NA,NA)
|
||||
|
||||
# thematic::thematic_shiny()
|
||||
|
||||
load_data <- function() {
|
||||
Sys.sleep(1)
|
||||
shinyjs::hide("loading_page")
|
||||
|
|
@ -13544,7 +13547,6 @@ server <- function(input, output, session) {
|
|||
# session$setCurrentTheme(bs_theme_update(theme = custom_theme(version = 5, bg = "#000",fg="#fff")))
|
||||
# })
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Setting reactive values
|
||||
|
|
@ -13637,16 +13639,33 @@ server <- function(input, output, session) {
|
|||
# ),
|
||||
# selected = "file"
|
||||
# )
|
||||
|
||||
if (isTRUE(global_freesearchR$include_globalenv)) {
|
||||
env_label <- i18n$t("Local or sample data")
|
||||
output$data_sample_text <- shiny::renderText(shiny::helpText(
|
||||
i18n$t(
|
||||
"Upload a file, get data directly from REDCap or use local or sample data."
|
||||
)
|
||||
))
|
||||
} else {
|
||||
env_label <- i18n$t("Sample data")
|
||||
output$data_sample_text <- shiny::renderUI(shiny::helpText(
|
||||
i18n$t(
|
||||
"Upload a file, get data directly from REDCap or use sample data."
|
||||
)
|
||||
))
|
||||
}
|
||||
|
||||
shiny::updateSelectInput(inputId = "source", choices = setNames(c("file", "redcap", "env"), c(
|
||||
i18n$t("File upload"),
|
||||
i18n$t("REDCap server export"),
|
||||
i18n$t("Local or sample data")
|
||||
env_label
|
||||
# i18n$t("Local or sample data")
|
||||
)))
|
||||
|
||||
# output$intro_text <- renderUI(includeHTML(i18n$t("www/intro.html")))
|
||||
})
|
||||
|
||||
|
||||
shiny::observeEvent(input$language_select, {
|
||||
bslib::accordion_panel_update(id = "acc_chars",
|
||||
title = i18n$t("Settings"),
|
||||
|
|
@ -13659,12 +13678,10 @@ server <- function(input, output, session) {
|
|||
target = "acc_pan_mis")
|
||||
})
|
||||
|
||||
|
||||
output$redcap_warning <- shiny::renderUI({
|
||||
rv_alerts$redcap_alert
|
||||
})
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Data import section
|
||||
|
|
@ -13798,7 +13815,6 @@ server <- function(input, output, session) {
|
|||
rv$data_original <- temp_data |>
|
||||
default_parsing()
|
||||
}
|
||||
|
||||
},
|
||||
ignoreNULL = FALSE
|
||||
)
|
||||
|
|
@ -13861,14 +13877,14 @@ server <- function(input, output, session) {
|
|||
shiny::observeEvent(list(rv$data_original, rv$data), {
|
||||
if (is.null(rv$data_original) |
|
||||
NROW(rv$data_original) == 0 |
|
||||
is.null(rv$data) | !any(is_splittable(rv$data))) {
|
||||
is.null(rv$data) |
|
||||
!any(is_splittable(rv$data))) {
|
||||
shiny::updateActionButton(inputId = "modal_string", disabled = TRUE)
|
||||
} else if (!is.null(rv$data) && any(is_splittable(rv$data))) {
|
||||
shiny::updateActionButton(inputId = "modal_string", disabled = FALSE)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Data modification section
|
||||
|
|
@ -13893,7 +13909,6 @@ server <- function(input, output, session) {
|
|||
}
|
||||
}, ignoreNULL = TRUE)
|
||||
|
||||
|
||||
shiny::observeEvent(input$data_reset, {
|
||||
shinyWidgets::ask_confirmation(
|
||||
cancelOnDismiss = TRUE,
|
||||
|
|
@ -14216,7 +14231,6 @@ server <- function(input, output, session) {
|
|||
rv$list$table1 <- NULL
|
||||
})
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Code export
|
||||
|
|
@ -14280,19 +14294,18 @@ server <- function(input, output, session) {
|
|||
))
|
||||
})
|
||||
|
||||
|
||||
## Just a note to self
|
||||
## This is a very rewarding couple of lines marking new insights to dynamically rendering code
|
||||
shiny::observe({
|
||||
shiny::req(rv$regression)
|
||||
rv$regression()$regression$models |> purrr::imap(\(.x, .i) {
|
||||
output[[paste0("code_", tolower(.i))]] <- shiny::renderUI({
|
||||
prismCodeBlock(paste0(paste("#", .i, "regression model\n"), .x$code_table))
|
||||
rv$regression()$regression$models |>
|
||||
purrr::imap(\(.x, .i) {
|
||||
output[[paste0("code_", tolower(.i))]] <- shiny::renderUI({
|
||||
prismCodeBlock(paste0(paste("#", .i, "regression model\n"), .x$code_table))
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Data analyses Inputs
|
||||
|
|
@ -14305,7 +14318,8 @@ server <- function(input, output, session) {
|
|||
selected = "none",
|
||||
label = i18n$t("Select variable to stratify baseline"),
|
||||
data = shiny::reactive(rv$data_filtered)(),
|
||||
col_subset = c("none", names(rv$data_filtered)[unlist(lapply(rv$data_filtered, data_type)) %in% c("dichotomous", "categorical", "ordinal")])
|
||||
col_subset = c("none", names(rv$data_filtered)[unlist(lapply(rv$data_filtered, data_type)) %in%
|
||||
c("dichotomous", "categorical", "ordinal")])
|
||||
)
|
||||
})
|
||||
|
||||
|
|
@ -14324,7 +14338,6 @@ server <- function(input, output, session) {
|
|||
# )
|
||||
# })
|
||||
|
||||
|
||||
output$detail_level <- shiny::renderUI({
|
||||
shiny::radioButtons(
|
||||
inputId = "detail_level",
|
||||
|
|
@ -14336,14 +14349,12 @@ server <- function(input, output, session) {
|
|||
)
|
||||
})
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Descriptive evaluations
|
||||
#########
|
||||
##############################################################################
|
||||
|
||||
|
||||
output$data_info_nochar <- shiny::renderUI({
|
||||
shiny::req(rv$list$data)
|
||||
data_description(rv$list$data,
|
||||
|
|
@ -14362,14 +14373,12 @@ server <- function(input, output, session) {
|
|||
#
|
||||
# })
|
||||
|
||||
|
||||
shiny::observeEvent(list(input$act_eval), {
|
||||
shiny::req(input$strat_var)
|
||||
# shiny::req(input$baseline_theme)
|
||||
shiny::req(input$detail_level)
|
||||
shiny::req(rv$list$data)
|
||||
|
||||
|
||||
parameters <- list(
|
||||
by.var = input$strat_var,
|
||||
add.p = input$add_p == "yes",
|
||||
|
|
@ -14410,7 +14419,6 @@ server <- function(input, output, session) {
|
|||
# }
|
||||
# )
|
||||
|
||||
|
||||
rv$code$table1 <- glue::glue("FreesearchR::create_baseline(df,{list2str(parameters)})")
|
||||
})
|
||||
|
||||
|
|
@ -14451,12 +14459,9 @@ server <- function(input, output, session) {
|
|||
|
||||
## Missingness evaluation
|
||||
|
||||
|
||||
rv$missings <- data_missings_server(id = "missingness",
|
||||
data = shiny::reactive(rv$data_filtered))
|
||||
|
||||
|
||||
|
||||
# shiny::observe({
|
||||
# req(rv$missings())
|
||||
# browser()
|
||||
|
|
@ -14465,7 +14470,6 @@ server <- function(input, output, session) {
|
|||
# mcar_validate(data=rv$missings()[["_data"]],outcome = input$missings_var)
|
||||
# })
|
||||
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Data visuals
|
||||
|
|
|
|||
|
|
@ -314,16 +314,17 @@
|
|||
"The app contains a selelct number of features and will guide you through key analyses.","Appen indeholder udvalgte funktioner, og guider dig gennem de vigtigste analyser."
|
||||
"Sort by Levels","Sorter efter niveauer"
|
||||
"Reorder factor levels","Omarranger niveauer"
|
||||
"Modify factor levels","Modify factor levels"
|
||||
"Reorder or rename the levels of factor/categorical variables.","Reorder or rename the levels of factor/categorical variables."
|
||||
"Maximum number of observations:","Maximum number of observations:"
|
||||
"setting to 0 includes all","setting to 0 includes all"
|
||||
"Select a dataset from your environment or sample dataset from a package.","Select a dataset from your environment or sample dataset from a package."
|
||||
"Select a sample dataset from a package.","Select a sample dataset from a package."
|
||||
"Data ready to be imported!","Data ready to be imported!"
|
||||
"Data has %s obs. of %s variables.","Data has %s obs. of %s variables."
|
||||
"Modify factor levels","Ændr kategoriske niveauer"
|
||||
"Reorder or rename the levels of factor/categorical variables.","Ændr navn eller rækkefølge på kategorisk variabel."
|
||||
"Maximum number of observations:","Maximale antal observationer:"
|
||||
"setting to 0 includes all","angiv 0 for at inkludere alle"
|
||||
"Select a dataset from your environment or sample dataset from a package.","Vælg et datasæt fra din kørende session eller vælg træningsdata."
|
||||
"Select a sample dataset from a package.","Vælg et træningsdatasæt."
|
||||
"Data ready to be imported!","Data er klar til at blive importeret!"
|
||||
"Data has %s obs. of %s variables.","Data har %s obs. på %s variabler."
|
||||
"Data successfully imported!","Data successfully imported!"
|
||||
"Click to see data","Click to see data"
|
||||
"No data present.","No data present."
|
||||
"You have provided a complete dataset with no missing values.","You have provided a complete dataset with no missing values."
|
||||
"Start by loading data.","Start by loading data."
|
||||
"Click to see data","Klik for at se data"
|
||||
"No data present.","Ingen data tilstede."
|
||||
"You have provided a complete dataset with no missing values.","Data er uden manglende observationer."
|
||||
"Start by loading data.","Start med at vælge data."
|
||||
"Sample data","Træningsdata"
|
||||
|
|
|
|||
|
|
|
@ -327,3 +327,4 @@
|
|||
"No data present.","No data present."
|
||||
"You have provided a complete dataset with no missing values.","You have provided a complete dataset with no missing values."
|
||||
"Start by loading data.","Start by loading data."
|
||||
"Sample data","Sample data"
|
||||
|
|
|
|||
|
BIN
app_docker/www/fonts/Montserrat-Regular.ttf
Executable file
BIN
app_docker/www/fonts/Montserrat-Regular.ttf
Executable file
Binary file not shown.
BIN
app_docker/www/fonts/OpenSans-Regular.ttf
Executable file
BIN
app_docker/www/fonts/OpenSans-Regular.ttf
Executable file
Binary file not shown.
BIN
app_docker/www/fonts/PublicSans-Bold.ttf
Executable file
BIN
app_docker/www/fonts/PublicSans-Bold.ttf
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue