new version

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-07-03 16:20:15 +02:00
parent ec5603d368
commit 5c5f118f6e
No known key found for this signature in database
18 changed files with 648 additions and 538 deletions

View file

@ -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.6.4 version: 25.7.1
doi: 10.5281/zenodo.14527429 doi: 10.5281/zenodo.14527429
identifiers: identifiers:
- type: url - type: url

View file

@ -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.6.4 Version: 25.7.1
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")),

View file

@ -17,6 +17,7 @@ export(clean_common_axis)
export(clean_date) export(clean_date)
export(clean_sep) export(clean_sep)
export(columnSelectInput) export(columnSelectInput)
export(compare_missings)
export(contrast_text) export(contrast_text)
export(create_baseline) export(create_baseline)
export(create_column_server) export(create_column_server)

View file

@ -1,3 +1,7 @@
# FreesearchR 25.7.1 - DEV
- *NEW* UI overhaul and navigation update. The interface is simplified to clearly show the relationship between panels and sub-items by abandoning multiple levels on panel to instead show a drop-down menu. This also results in simplified sidebar menus with room to add more controls in the future.
# FreesearchR 25.6.4 # FreesearchR 25.6.4
The app is now also published as a docker container. See the README for instructions. It is mainly to use for hosting the app. Work is ongoing to publish a true standalone app, preferably for both Windows and MacOS. The app is now also published as a docker container. See the README for instructions. It is mainly to use for hosting the app. Work is ongoing to publish a true standalone app, preferably for both Windows and MacOS.

View file

@ -1 +1 @@
app_version <- function()'25.6.4' app_version <- function()'25.7.1'

View file

@ -1 +1 @@
hosted_version <- function()'v25.6.4-250627' hosted_version <- function()'v25.7.1-250703'

Binary file not shown.

View file

@ -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-06-27 | |date |2025-07-03 |
|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.6.4.250627 | |FreesearchR |25.7.1.250703 |
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -52,6 +52,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 |1.9.5 |2025-03-17 |CRAN (R 4.4.1) | |commonmark |1.9.5 |2025-03-17 |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) |
|crosstalk |1.2.1 |2023-11-23 |CRAN (R 4.4.0) |
|data.table |1.17.0 |2025-02-22 |CRAN (R 4.4.1) | |data.table |1.17.0 |2025-02-22 |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) |
|datawizard |1.0.2 |2025-03-24 |CRAN (R 4.4.1) | |datawizard |1.0.2 |2025-03-24 |CRAN (R 4.4.1) |
@ -65,6 +66,7 @@
|DT |0.33 |2024-04-04 |CRAN (R 4.4.0) | |DT |0.33 |2024-04-04 |CRAN (R 4.4.0) |
|e1071 |1.7-16 |2024-09-16 |CRAN (R 4.4.1) | |e1071 |1.7-16 |2024-09-16 |CRAN (R 4.4.1) |
|easystats |0.7.4 |2025-02-06 |CRAN (R 4.4.1) | |easystats |0.7.4 |2025-02-06 |CRAN (R 4.4.1) |
|effectsize |1.0.0 |2024-12-10 |CRAN (R 4.4.1) |
|ellipsis |0.3.2 |2021-04-29 |CRAN (R 4.4.1) | |ellipsis |0.3.2 |2021-04-29 |CRAN (R 4.4.1) |
|emmeans |1.11.1 |2025-05-04 |CRAN (R 4.4.1) | |emmeans |1.11.1 |2025-05-04 |CRAN (R 4.4.1) |
|esquisse |2.1.0 |2025-02-21 |CRAN (R 4.4.1) | |esquisse |2.1.0 |2025-02-21 |CRAN (R 4.4.1) |
@ -82,7 +84,7 @@
|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.6.4 |NA |NA | |FreesearchR |25.7.1 |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.3 |2022-07-05 |CRAN (R 4.4.1) | |generics |0.1.3 |2022-07-05 |CRAN (R 4.4.1) |
@ -114,15 +116,19 @@
|keyring |1.3.2 |2023-12-11 |CRAN (R 4.4.0) | |keyring |1.3.2 |2023-12-11 |CRAN (R 4.4.0) |
|knitr |1.50 |2025-03-16 |CRAN (R 4.4.1) | |knitr |1.50 |2025-03-16 |CRAN (R 4.4.1) |
|labeling |0.4.3 |2023-08-29 |CRAN (R 4.4.1) | |labeling |0.4.3 |2023-08-29 |CRAN (R 4.4.1) |
|labelled |2.14.0 |2025-01-08 |CRAN (R 4.4.1) |
|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) |
|mgcv |1.9-3 |2025-04-04 |CRAN (R 4.4.1) |
|mime |0.13 |2025-03-17 |CRAN (R 4.4.1) | |mime |0.13 |2025-03-17 |CRAN (R 4.4.1) |
|miniUI |0.1.2 |2025-04-17 |CRAN (R 4.4.1) | |miniUI |0.1.2 |2025-04-17 |CRAN (R 4.4.1) |
|minqa |1.2.8 |2024-08-17 |CRAN (R 4.4.1) | |minqa |1.2.8 |2024-08-17 |CRAN (R 4.4.1) |
@ -213,11 +219,8 @@
|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.4 |2023-10-22 |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) |
|vctrs |0.6.5 |2023-12-01 |CRAN (R 4.4.0) | |vctrs |0.6.5 |2023-12-01 |CRAN (R 4.4.0) |
|viridis |0.6.5 |2024-01-29 |CRAN (R 4.4.0) |
|viridisLite |0.4.2 |2023-05-02 |CRAN (R 4.4.1) |
|vroom |1.6.5 |2023-12-05 |CRAN (R 4.4.0) | |vroom |1.6.5 |2023-12-05 |CRAN (R 4.4.0) |
|withr |3.0.2 |2024-10-28 |CRAN (R 4.4.1) | |withr |3.0.2 |2024-10-28 |CRAN (R 4.4.1) |
|writexl |1.5.4 |2025-04-15 |CRAN (R 4.4.1) | |writexl |1.5.4 |2025-04-15 |CRAN (R 4.4.1) |

View file

@ -5,7 +5,7 @@
######## ########
library(shiny) library(shiny)
# library(shinyjs) library(shinyjs)
# library(methods) # library(methods)
# library(readr) # library(readr)
# library(MASS) # library(MASS)
@ -49,7 +49,7 @@ library(rlang)
#### Current file: /Users/au301842/FreesearchR/R//app_version.R #### Current file: /Users/au301842/FreesearchR/R//app_version.R
######## ########
app_version <- function()'25.6.3' app_version <- function()'25.7.1'
######## ########
@ -1611,10 +1611,8 @@ plot_histogram <- function(data, column=NULL, bins = 30, breaks = NULL, color =
data_visuals_ui <- function(id, tab_title = "Plots", ...) { data_visuals_ui <- function(id, tab_title = "Plots", ...) {
ns <- shiny::NS(id) ns <- shiny::NS(id)
# bslib::navset_bar(
list( list(
bslib::layout_sidebar(
# Sidebar with a slider input
sidebar = bslib::sidebar( sidebar = bslib::sidebar(
bslib::accordion( bslib::accordion(
multiple = FALSE, multiple = FALSE,
@ -1637,10 +1635,6 @@ data_visuals_ui <- function(id, tab_title = "Plots", ...) {
), ),
shiny::helpText('Adjust settings, then press "Plot".') shiny::helpText('Adjust settings, then press "Plot".')
), ),
# bslib::accordion_panel(
# title = "Advanced",
# icon = bsicons::bs_icon("gear")
# ),
bslib::accordion_panel( bslib::accordion_panel(
title = "Download", title = "Download",
icon = bsicons::bs_icon("download"), icon = bsicons::bs_icon("download"),
@ -1692,16 +1686,21 @@ data_visuals_ui <- function(id, tab_title = "Plots", ...) {
icon = shiny::icon("download") icon = shiny::icon("download")
) )
) )
)
), ),
bslib::nav_panel( shiny::p("We have collected a few notes on visualising data and details on the options included in FreesearchR:", shiny::tags$a(
title = tab_title, href = "https://agdamsbo.github.io/FreesearchR/articles/visuals.html",
"View notes in new tab",
target = "_blank",
rel = "noopener noreferrer"
))
),
shiny::plotOutput(ns("plot"), height = "70vh"), shiny::plotOutput(ns("plot"), height = "70vh"),
shiny::tags$br(), shiny::tags$br(),
shiny::tags$br(), shiny::tags$br(),
shiny::htmlOutput(outputId = ns("code_plot")) shiny::htmlOutput(outputId = ns("code_plot"))
) )
) )
# )
} }
@ -1937,7 +1936,14 @@ data_visuals_server <- function(id,
) )
shiny::withProgress(message = "Drawing the plot. Hold tight for a moment..", { shiny::withProgress(message = "Drawing the plot. Hold tight for a moment..", {
rv$plot <- rlang::exec(create_plot, !!!append_list(data(), parameters, "data")) rv$plot <- rlang::exec(
create_plot,
!!!append_list(
data(),
parameters,
"data"
)
)
}) })
rv$code <- glue::glue("FreesearchR::create_plot(df,{list2str(parameters)})") rv$code <- glue::glue("FreesearchR::create_plot(df,{list2str(parameters)})")
@ -1993,13 +1999,12 @@ data_visuals_server <- function(id,
paste0("plot.", input$plot_type) paste0("plot.", input$plot_type)
}), }),
content = function(file) { content = function(file) {
if (inherits(rv$plot,"patchwork")){ if (inherits(rv$plot, "patchwork")) {
plot <- rv$plot plot <- rv$plot
} else if (inherits(rv$plot,"ggplot")){ } else if (inherits(rv$plot, "ggplot")) {
plot <- rv$plot plot <- rv$plot
}else { } else {
plot <- rv$plot[[1]] plot <- rv$plot[[1]]
} }
# browser() # browser()
shiny::withProgress(message = "Drawing the plot. Hold on for a moment..", { shiny::withProgress(message = "Drawing the plot. Hold on for a moment..", {
@ -2259,12 +2264,12 @@ create_plot <- function(data, type, pri, sec, ter = NULL, ...) {
out <- do.call( out <- do.call(
type, type,
modifyList(parameters,list(data=data)) modifyList(parameters, list(data = data))
) )
code <- rlang::call2(type,!!!parameters,.ns = "FreesearchR") code <- rlang::call2(type, !!!parameters, .ns = "FreesearchR")
attr(out,"code") <- code attr(out, "code") <- code
out out
} }
@ -2319,6 +2324,7 @@ get_label <- function(data, var = NULL) {
#' paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(force = TRUE) #' paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(force = TRUE)
line_break <- function(data, lineLength = 20, force = FALSE) { line_break <- function(data, lineLength = 20, force = FALSE) {
if (isTRUE(force)) { if (isTRUE(force)) {
## This eats some letters when splitting a sentence... ??
gsub(paste0("(.{1,", lineLength, "})(\\s|[[:alnum:]])"), "\\1\n", data) gsub(paste0("(.{1,", lineLength, "})(\\s|[[:alnum:]])"), "\\1\n", data)
} else { } else {
paste(strwrap(data, lineLength), collapse = "\n") paste(strwrap(data, lineLength), collapse = "\n")
@ -2331,11 +2337,17 @@ line_break <- function(data, lineLength = 20, force = FALSE) {
#' #'
#' @param data list of ggplot2 objects #' @param data list of ggplot2 objects
#' @param tag_levels passed to patchwork::plot_annotation if given. Default is NULL #' @param tag_levels passed to patchwork::plot_annotation if given. Default is NULL
#' @param title panel title
#' @param ... ignored for argument overflow
#' #'
#' @returns list of ggplot2 objects #' @returns list of ggplot2 objects
#' @export #' @export
#' #'
wrap_plot_list <- function(data, tag_levels = NULL) { wrap_plot_list <- function(data,
tag_levels = NULL,
title = NULL,
axis.font.family = NULL,
...) {
if (ggplot2::is_ggplot(data[[1]])) { if (ggplot2::is_ggplot(data[[1]])) {
if (length(data) > 1) { if (length(data) > 1) {
out <- data |> out <- data |>
@ -2349,17 +2361,35 @@ wrap_plot_list <- function(data, tag_levels = NULL) {
} }
})() |> })() |>
align_axes() |> align_axes() |>
patchwork::wrap_plots(guides = "collect", axes = "collect", axis_titles = "collect") patchwork::wrap_plots(
guides = "collect",
axes = "collect",
axis_titles = "collect"
)
if (!is.null(tag_levels)) { if (!is.null(tag_levels)) {
out <- out + patchwork::plot_annotation(tag_levels = tag_levels) out <- out + patchwork::plot_annotation(tag_levels = tag_levels)
} }
if (!is.null(title)) {
out <- out +
patchwork::plot_annotation(
title = title,
theme = ggplot2::theme(plot.title = ggplot2::element_text(size = 25))
)
}
} else { } else {
out <- data out <- data[[1]]
} }
} else { } else {
cli::cli_abort("Can only wrap lists of {.cls ggplot} objects") cli::cli_abort("Can only wrap lists of {.cls ggplot} objects")
} }
out
if (inherits(x = out, what = "patchwork")) {
out &
ggplot2::theme(axis.text = ggplot2::element_text(family = axis.font.family))
} else {
out +
ggplot2::theme(axis.text = ggplot2::element_text(family = axis.font.family))
}
} }
@ -3996,7 +4026,7 @@ simple_snake <- function(data){
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R #### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
######## ########
hosted_version <- function()'v25.6.3-250626' hosted_version <- function()'v25.7.1-250703'
######## ########
@ -4705,14 +4735,7 @@ data_missings_server <- function(id,
tryCatch( tryCatch(
{ {
if (!is.null(by_var) && by_var != "" && by_var %in% names(df_tbl)) { out <- compare_missings(df_tbl,by_var)
df_tbl[[by_var]] <- ifelse(is.na(df_tbl[[by_var]]), "Missing", "Non-missing")
out <- gtsummary::tbl_summary(df_tbl, by = by_var) |>
gtsummary::add_p()
} else {
out <- gtsummary::tbl_summary(df_tbl)
}
}, },
error = function(err) { error = function(err) {
showNotification(paste0("Error: ", err), type = "err") showNotification(paste0("Error: ", err), type = "err")
@ -4790,13 +4813,25 @@ missing_demo_app <- function() {
missing_demo_app() missing_demo_app()
#' Pairwise comparison of missings across covariables
#'
#' @param data data frame
#' @param by_var variable to stratify by missingness
#'
#' @returns gtsummary list object
#' @export
#'
compare_missings <- function(data,by_var){
if (!is.null(by_var) && by_var != "" && by_var %in% names(data)) {
data[[by_var]] <- ifelse(is.na(data[[by_var]]), "Missing", "Non-missing")
out <- gtsummary::tbl_summary(data, by = by_var) |>
gtsummary::add_p()
} else {
out <- gtsummary::tbl_summary(data)
}
out
}
######## ########
@ -4805,17 +4840,27 @@ missing_demo_app()
#' Beautiful box plot(s) #' Beautiful box plot(s)
#' #'
#' @param data data frame
#' @param pri primary variable
#' @param sec secondary variable
#' @param ter tertiary variable
#' @param ... passed on to wrap_plot_list
#'
#' @returns ggplot2 object #' @returns ggplot2 object
#' @export #' @export
#' #'
#' @name data-plots #' @name data-plots
#' #'
#' @examples #' @examples
#' mtcars |> plot_box(pri = "mpg", sec = "cyl", ter = "gear") #' mtcars |> plot_box(pri = "mpg", sec = "gear")
#' mtcars |> plot_box(pri = "mpg", sec="cyl")
#' mtcars |> #' mtcars |>
#' default_parsing() |> #' default_parsing() |>
#' plot_box(pri = "mpg", sec = "cyl", ter = "gear") #' plot_box(pri = "mpg", sec = "cyl", ter = "gear")
plot_box <- function(data, pri, sec, ter = NULL) { #' mtcars |>
#' default_parsing() |>
#' plot_box(pri = "mpg", sec = "cyl", ter = "gear",axis.font.family="mono")
plot_box <- function(data, pri, sec, ter = NULL,...) {
if (!is.null(ter)) { if (!is.null(ter)) {
ds <- split(data, data[ter]) ds <- split(data, data[ter])
} else { } else {
@ -4830,7 +4875,7 @@ plot_box <- function(data, pri, sec, ter = NULL) {
) )
}) })
wrap_plot_list(out) wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}"),...)
} }
@ -4846,6 +4891,7 @@ plot_box <- function(data, pri, sec, ter = NULL) {
#' @examples #' @examples
#' mtcars |> plot_box_single("mpg") #' mtcars |> plot_box_single("mpg")
#' mtcars |> plot_box_single("mpg","cyl") #' mtcars |> plot_box_single("mpg","cyl")
#' gtsummary::trial |> plot_box_single("age","trt")
plot_box_single <- function(data, pri, sec=NULL, seed = 2103) { plot_box_single <- function(data, pri, sec=NULL, seed = 2103) {
set.seed(seed) set.seed(seed)
@ -4861,6 +4907,8 @@ plot_box_single <- function(data, pri, sec=NULL, seed = 2103) {
ggplot2::geom_boxplot(linewidth = 1.8, outliers = FALSE) + ggplot2::geom_boxplot(linewidth = 1.8, outliers = FALSE) +
## THis could be optional in future ## THis could be optional in future
ggplot2::geom_jitter(color = "black", size = 2, alpha = 0.9, width = 0.1, height = .2) + ggplot2::geom_jitter(color = "black", size = 2, alpha = 0.9, width = 0.1, height = .2) +
ggplot2::xlab(get_label(data,pri))+
ggplot2::ylab(get_label(data,sec)) +
ggplot2::coord_flip() + ggplot2::coord_flip() +
viridis::scale_fill_viridis(discrete = discrete, option = "D") + viridis::scale_fill_viridis(discrete = discrete, option = "D") +
# ggplot2::theme_void() + # ggplot2::theme_void() +
@ -4983,7 +5031,7 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) {
}) })
# names(out) # names(out)
wrap_plot_list(out) wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}"))
# patchwork::wrap_plots(out, guides = "collect") # patchwork::wrap_plots(out, guides = "collect")
} }
@ -5458,7 +5506,7 @@ plot_violin <- function(data, pri, sec, ter = NULL) {
) )
}) })
wrap_plot_list(out) wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}"))
# patchwork::wrap_plots(out,guides = "collect") # patchwork::wrap_plots(out,guides = "collect")
} }
@ -7372,7 +7420,10 @@ regression_ui <- function(id, ...) {
ns <- shiny::NS(id) ns <- shiny::NS(id)
shiny::tagList( shiny::tagList(
title = "", # title = "",
bslib::nav_panel(
title = "Regression table",
bslib::layout_sidebar(
sidebar = bslib::sidebar( sidebar = bslib::sidebar(
shiny::uiOutput(outputId = ns("data_info"), inline = TRUE), shiny::uiOutput(outputId = ns("data_info"), inline = TRUE),
bslib::accordion( bslib::accordion(
@ -7447,7 +7498,19 @@ regression_ui <- function(id, ...) {
# ) # )
# ), # ),
shiny::tags$br() shiny::tags$br()
)
)
), ),
gt::gt_output(outputId = ns("table2"))
)
),
bslib::nav_panel(
title = "Coefficient plot",
bslib::layout_sidebar(
sidebar = bslib::sidebar(
bslib::accordion(
open = "acc_reg",
multiple = FALSE,
do.call( do.call(
bslib::accordion_panel, bslib::accordion_panel,
c( c(
@ -7501,7 +7564,19 @@ regression_ui <- function(id, ...) {
) )
) )
) )
)
)
), ),
shiny::plotOutput(outputId = ns("regression_plot"), height = "80vh")
)
),
bslib::nav_panel(
title = "Model checks",
bslib::layout_sidebar(
sidebar = bslib::sidebar(
bslib::accordion(
open = "acc_reg",
multiple = FALSE,
bslib::accordion_panel( bslib::accordion_panel(
value = "acc_checks", value = "acc_checks",
title = "Checks", title = "Checks",
@ -7510,19 +7585,10 @@ regression_ui <- function(id, ...) {
) )
) )
), ),
bslib::nav_panel(
title = "Regression table",
gt::gt_output(outputId = ns("table2"))
),
bslib::nav_panel(
title = "Coefficient plot",
shiny::plotOutput(outputId = ns("regression_plot"), height = "80vh")
),
bslib::nav_panel(
title = "Model checks",
shiny::plotOutput(outputId = ns("check"), height = "90vh") shiny::plotOutput(outputId = ns("check"), height = "90vh")
) )
) )
)
} }
@ -9831,6 +9897,8 @@ ui_elements <- list(
############################################################################## ##############################################################################
"home" = bslib::nav_panel( "home" = bslib::nav_panel(
title = "FreesearchR", title = "FreesearchR",
# title = shiny::div(htmltools::img(src="FreesearchR-logo-white-nobg-h80.png")),
icon = shiny::icon("house"),
shiny::fluidRow( shiny::fluidRow(
## 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"
@ -9842,8 +9910,7 @@ ui_elements <- list(
shiny::markdown(readLines("www/intro.md")), shiny::markdown(readLines("www/intro.md")),
shiny::column(width = 2) shiny::column(width = 2)
) )
), )
icon = shiny::icon("home")
), ),
############################################################################## ##############################################################################
######### #########
@ -9851,7 +9918,8 @@ ui_elements <- list(
######### #########
############################################################################## ##############################################################################
"import" = bslib::nav_panel( "import" = bslib::nav_panel(
title = "Import", title = "Get started",
icon = shiny::icon("upload"),
shiny::fluidRow( shiny::fluidRow(
shiny::column(width = 2), shiny::column(width = 2),
shiny::column( shiny::column(
@ -9969,15 +10037,13 @@ ui_elements <- list(
######### Data overview panel ######### Data overview panel
######### #########
############################################################################## ##############################################################################
"overview" = "prepare" = bslib::nav_menu(
# bslib::nav_panel_hidden( title = "Prepare",
bslib::nav_panel( icon = shiny::icon("pen-to-square"),
# value = "overview",
title = "Data",
bslib::navset_bar(
fillable = TRUE,
bslib::nav_panel( bslib::nav_panel(
title = "Overview", title = "Overview",
icon = shiny::icon("eye"),
value = "nav_prepare_overview",
tags$h3("Overview and filtering"), tags$h3("Overview and filtering"),
fluidRow( fluidRow(
shiny::column( shiny::column(
@ -10019,22 +10085,6 @@ ui_elements <- list(
), ),
shiny::column( shiny::column(
width = 3, width = 3,
# shiny::actionButton(
# inputId = "modal_missings",
# label = "Visual overview",
# width = "100%",
# disabled = TRUE
# ),
# shiny::br(),
# shiny::br(),
# shiny::actionButton(
# inputId = "modal_browse",
# label = "Browse data",
# width = "100%",
# disabled = TRUE
# ),
# shiny::br(),
# shiny::br(),
shiny::tags$h6("Filter data types"), shiny::tags$h6("Filter data types"),
shiny::uiOutput( shiny::uiOutput(
outputId = "column_filter" outputId = "column_filter"
@ -10056,12 +10106,11 @@ ui_elements <- list(
), ),
shiny::br(), shiny::br(),
shiny::br(), shiny::br(),
# shiny::br(),
# shiny::br(),
shiny::br() shiny::br()
), ),
bslib::nav_panel( bslib::nav_panel(
title = "Modify", title = "Modify",
icon = shiny::icon("file-pen"),
tags$h3("Subset, rename and convert variables"), tags$h3("Subset, rename and convert variables"),
fluidRow( fluidRow(
shiny::column( shiny::column(
@ -10073,7 +10122,6 @@ ui_elements <- list(
) )
) )
), ),
# shiny::tags$br(),
update_variables_ui("modal_variables"), update_variables_ui("modal_variables"),
shiny::tags$br(), shiny::tags$br(),
shiny::tags$br(), shiny::tags$br(),
@ -10129,13 +10177,11 @@ ui_elements <- list(
shiny::column( shiny::column(
width = 6, width = 6,
shiny::tags$b("Original data:"), shiny::tags$b("Original data:"),
# verbatimTextOutput("original"),
shiny::verbatimTextOutput("original_str") shiny::verbatimTextOutput("original_str")
), ),
shiny::column( shiny::column(
width = 6, width = 6,
shiny::tags$b("Modified data:"), shiny::tags$b("Modified data:"),
# verbatimTextOutput("modified"),
shiny::verbatimTextOutput("modified_str") shiny::verbatimTextOutput("modified_str")
) )
), ),
@ -10149,7 +10195,7 @@ ui_elements <- list(
shiny::helpText("Reset to original imported dataset. Careful! There is no un-doing."), shiny::helpText("Reset to original imported dataset. Careful! There is no un-doing."),
shiny::tags$br() shiny::tags$br()
) )
) # )
), ),
############################################################################## ##############################################################################
######### #########
@ -10157,22 +10203,28 @@ ui_elements <- list(
######### #########
############################################################################## ##############################################################################
"describe" = "describe" =
bslib::nav_panel( bslib::nav_menu(
title = "Evaluate", title = "Evaluate",
id = "navdescribe", icon = shiny::icon("magnifying-glass-chart"),
bslib::navset_bar( # id = "navdescribe",
title = "", # bslib::navset_bar(
# title = "",
bslib::nav_panel(
title = "Characteristics",
icon = bsicons::bs_icon("table"),
bslib::layout_sidebar(
sidebar = bslib::sidebar( sidebar = bslib::sidebar(
shiny::uiOutput(outputId = "data_info_nochar", inline = TRUE), shiny::uiOutput(outputId = "data_info_nochar", inline = TRUE),
bslib::accordion( bslib::accordion(
open = "acc_chars", open = "acc_chars",
multiple = FALSE, multiple = FALSE,
bslib::accordion_panel( bslib::accordion_panel(
open = TRUE,
value = "acc_chars", value = "acc_chars",
title = "Characteristics", title = "Settings",
icon = bsicons::bs_icon("table"), icon = bsicons::bs_icon("table"),
shiny::uiOutput("strat_var"), shiny::uiOutput("strat_var"),
shiny::helpText("Only factor/categorical variables are available for stratification. Go back to the 'Data' tab to reclass a variable if it's not on the list."), shiny::helpText("Only factor/categorical variables are available for stratification. Go back to the 'Prepare' tab to reclass a variable if it's not on the list."),
shiny::conditionalPanel( shiny::conditionalPanel(
condition = "input.strat_var!='none'", condition = "input.strat_var!='none'",
shiny::radioButtons( shiny::radioButtons(
@ -10196,9 +10248,23 @@ ui_elements <- list(
icon = shiny::icon("calculator"), icon = shiny::icon("calculator"),
disabled = TRUE disabled = TRUE
) )
)
)
), ),
gt::gt_output(outputId = "table1")
)
),
bslib::nav_panel(
title = "Correlations",
icon = bsicons::bs_icon("bounding-box"),
bslib::layout_sidebar(
sidebar = bslib::sidebar(
shiny::uiOutput(outputId = "data_info_nochar", inline = TRUE),
bslib::accordion(
open = "acc_chars",
multiple = FALSE,
bslib::accordion_panel( bslib::accordion_panel(
vlaue = "acc_cor", value = "acc_cor",
title = "Correlations", title = "Correlations",
icon = bsicons::bs_icon("bounding-box"), icon = bsicons::bs_icon("bounding-box"),
shiny::uiOutput("outcome_var_cor"), shiny::uiOutput("outcome_var_cor"),
@ -10215,26 +10281,29 @@ ui_elements <- list(
color = datamods:::get_primary_color() color = datamods:::get_primary_color()
), ),
shiny::helpText("Set the cut-off for considered 'highly correlated'.") shiny::helpText("Set the cut-off for considered 'highly correlated'.")
)
)
), ),
data_correlations_ui(id = "correlations", height = 600)
)
),
bslib::nav_panel(
title = "Missings",
icon = bsicons::bs_icon("x-circle"),
bslib::layout_sidebar(
sidebar = bslib::sidebar(
bslib::accordion(
open = "acc_chars",
multiple = FALSE,
bslib::accordion_panel( bslib::accordion_panel(
vlaue = "acc_mis", vlaue = "acc_mis",
title = "Missings", title = "Missings",
icon = bsicons::bs_icon("x-circle"), icon = bsicons::bs_icon("x-circle"),
shiny::uiOutput("missings_var"), shiny::uiOutput("missings_var"),
shiny::helpText("To consider if daata is missing by random, choose the outcome/dependent variable, if it has any missings to evaluate if there is a significant difference across other variables depending on missing data or not.") shiny::helpText("To consider if data is missing by random, choose the outcome/dependent variable, if it has any missings to evaluate if there is a significant difference across other variables depending on missing data or not.")
) )
) )
), ),
bslib::nav_panel(
title = "Characteristics",
gt::gt_output(outputId = "table1")
),
bslib::nav_panel(
title = "Correlations",
data_correlations_ui(id = "correlations", height = 600)
),
bslib::nav_panel(
title = "Missings",
data_missings_ui(id = "missingness") data_missings_ui(id = "missingness")
) )
) )
@ -10244,27 +10313,23 @@ ui_elements <- list(
######### Download panel ######### Download panel
######### #########
############################################################################## ##############################################################################
"visuals" = bslib::nav_panel( "visuals" = do.call(
title = "Visuals", bslib::nav_panel,
id = "navvisuals",
do.call(
bslib::navset_bar,
c( c(
data_visuals_ui("visuals"), list(
shiny::tagList( title = "Visuals",
bslib::nav_spacer(), icon = shiny::icon("chart-line"),
bslib::nav_item( id = "navvisuals"
# shiny::img(shiny::icon("book")), ),
shiny::tags$a( data_visuals_ui("visuals")
href = "https://agdamsbo.github.io/FreesearchR/articles/visuals.html",
"Notes (external)",
target = "_blank",
rel = "noopener noreferrer"
)
)
)
)
) )
# do.call(
# bslib::navset_bar,
# data_visuals_ui("visuals")#,
# c(
# )
# )
), ),
############################################################################## ##############################################################################
######### #########
@ -10274,9 +10339,10 @@ ui_elements <- list(
"analyze" = "analyze" =
bslib::nav_panel( bslib::nav_panel(
title = "Regression", title = "Regression",
icon = shiny::icon("calculator"),
id = "navanalyses", id = "navanalyses",
do.call( do.call(
bslib::navset_bar, bslib::navset_card_tab,
regression_ui("regression") regression_ui("regression")
) )
), ),
@ -10288,6 +10354,7 @@ ui_elements <- list(
"download" = "download" =
bslib::nav_panel( bslib::nav_panel(
title = "Download", title = "Download",
icon = shiny::icon("download"),
id = "navdownload", id = "navdownload",
shiny::fluidRow( shiny::fluidRow(
shiny::column(width = 2), shiny::column(width = 2),
@ -10413,9 +10480,25 @@ dark <- custom_theme(
# https://webdesignerdepot.com/17-open-source-fonts-youll-actually-love/ # https://webdesignerdepot.com/17-open-source-fonts-youll-actually-love/
ui <- bslib::page_fixed( ui <- bslib::page_fixed(
## Code formatting dependencies
prismDependencies, prismDependencies,
prismRDependency, prismRDependency,
## Version dependent header
header_include(), header_include(),
## Automatically close drop-downs on navigation
## Thanks to claude.ai
tags$script("
$(document).on('shown.bs.tab', '#main_panel', function(e) {
// Close dropdown in this specific navset only
$('#main_panel .dropdown-menu').removeClass('show');
$('#main_panel .dropdown-toggle').removeClass('show').attr('aria-expanded', 'false');
// THE BELOW DOES NOT WORK
// Close navbar collapse (burger menu)
$('#main_panel .navbar-collapse collapse').removeClass('show');
$('#main_panel .navbar-toggle').removeClass('collapsed').attr('aria-expanded', 'false');
});
"),
## This adds the actual favicon ## This adds the actual favicon
## png and ico versions are kept for compatibility ## png and ico versions are kept for compatibility
shiny::tags$head(tags$link(rel = "shortcut icon", href = "favicon.svg")), shiny::tags$head(tags$link(rel = "shortcut icon", href = "favicon.svg")),
@ -10435,14 +10518,14 @@ ui <- bslib::page_fixed(
id = "main_panel", id = "main_panel",
ui_elements$home, ui_elements$home,
ui_elements$import, ui_elements$import,
ui_elements$overview, ui_elements$prepare,
ui_elements$describe, ui_elements$describe,
ui_elements$visuals, ui_elements$visuals,
ui_elements$analyze, ui_elements$analyze,
ui_elements$download, ui_elements$download,
bslib::nav_spacer(), bslib::nav_spacer(),
ui_elements$feedback, # ui_elements$feedback,
ui_elements$docs, # ui_elements$docs,
fillable = FALSE, fillable = FALSE,
footer = shiny::tags$footer( footer = shiny::tags$footer(
style = "background-color: #14131326; padding: 4px; text-align: center; bottom: 0; width: 100%;", style = "background-color: #14131326; padding: 4px; text-align: center; bottom: 0; width: 100%;",
@ -10452,7 +10535,7 @@ ui <- bslib::page_fixed(
), ),
shiny::p( shiny::p(
style = "margin: 1; color: #888;", style = "margin: 1; color: #888;",
shiny::tags$a("Docs", href = "https://agdamsbo.github.io/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", hosted_version(), " | ", shiny::tags$a("License: AGPLv3", href = "https://github.com/agdamsbo/FreesearchR/blob/main/LICENSE.md", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Source", href = "https://github.com/agdamsbo/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Share feedback", href = "https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8", target = "_blank", rel = "noopener noreferrer") shiny::tags$a("Documentation", href = "https://agdamsbo.github.io/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", hosted_version(), " | ", shiny::tags$a("License: AGPLv3", href = "https://github.com/agdamsbo/FreesearchR/blob/main/LICENSE.md", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Source", href = "https://github.com/agdamsbo/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Share feedback", href = "https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8", target = "_blank", rel = "noopener noreferrer")
), ),
) )
) )
@ -11164,7 +11247,7 @@ server <- function(input, output, session) {
############################################################################## ##############################################################################
shiny::observeEvent(input$act_start, { shiny::observeEvent(input$act_start, {
bslib::nav_select(id = "main_panel", selected = "Data") bslib::nav_select(id = "main_panel", selected = "nav_prepare_overview")
}) })
############################################################################## ##############################################################################

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

19
man/compare_missings.Rd Normal file
View file

@ -0,0 +1,19 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/missings-module.R
\name{compare_missings}
\alias{compare_missings}
\title{Pairwise comparison of missings across covariables}
\usage{
compare_missings(data, by_var)
}
\arguments{
\item{data}{data frame}
\item{by_var}{variable to stratify by missingness}
}
\value{
gtsummary list object
}
\description{
Pairwise comparison of missings across covariables
}