diff --git a/CITATION.cff b/CITATION.cff index 5578f1a5..ae7ae538 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "FreesearchR" in publications use:' type: software license: AGPL-3.0-or-later title: 'FreesearchR: Easy data analysis for clinicians' -version: 26.3.5 +version: 26.3.6 doi: 10.5281/zenodo.14527429 identifiers: - type: url diff --git a/DESCRIPTION b/DESCRIPTION index 3a60d461..23174866 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FreesearchR Title: Easy data analysis for clinicians -Version: 26.3.5 +Version: 26.3.6 Authors@R: c( person("Andreas Gammelgaard", "Damsbo",email="agdamsbo@clin.au.dk", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7559-1154")), diff --git a/NEWS.md b/NEWS.md index 7c2bbc32..5773bef8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# FreesearchR 26.3.6 + +*FIX* Plot single variable in Likert plot. + +*FIX* Horisontal stacked plot crashed. Fixed! + # FreesearchR 26.3.5 *FIX* Labelled categorical variables were not handled correctly importing from REDCap resulting in lost labels. Fixed! diff --git a/R/app_version.R b/R/app_version.R index bdf15ee5..ac06a8a2 100644 --- a/R/app_version.R +++ b/R/app_version.R @@ -1 +1 @@ -app_version <- function()'26.3.5' +app_version <- function()'26.3.6' diff --git a/R/data_plots.R b/R/data_plots.R index 1ae13694..439b0ccf 100644 --- a/R/data_plots.R +++ b/R/data_plots.R @@ -117,18 +117,7 @@ data_visuals_ui <- function(id, tab_title = "Plots", ...) { #' @export data_visuals_server <- function(id, data, - palettes = c( - "Perceptual (blue-yellow)" = "viridis", - "Perceptual (fire)" = "plasma", - "Colour-blind friendly" = "Okabe-Ito", - "Qualitative (bold)" = "Dark 2", - "Qualitative (paired)" = "Paired", - "Sequential (blues)" = "Blues", - "Diverging (red-blue)" = "RdBu", - "Tableau style" = "Tableau 10", - "Pastel" = "Pastel 1", - "Rainbow" = "rainbow" - ), + palettes, ...) { shiny::moduleServer( id = id, @@ -150,100 +139,6 @@ data_visuals_server <- function(id, title = i18n$t("Download")) }) - # ## --- New attempt - # - # rv$plot.params <- shiny::reactive({ - # get_plot_options(input$type) |> purrr::pluck(1) - # }) - # - # c(output, - # list(shiny::renderUI({ - # columnSelectInput( - # inputId = ns("primary"), - # data = data, - # placeholder = "Select variable", - # label = "Response variable", - # multiple = FALSE - # ) - # }), - # shiny::renderUI({ - # shiny::req(input$primary) - # # browser() - # - # if (!input$primary %in% names(data())) { - # plot_data <- data()[1] - # } else { - # plot_data <- data()[input$primary] - # } - # - # plots <- possible_plots( - # data = plot_data - # ) - # - # plots_named <- get_plot_options(plots) |> - # lapply(\(.x){ - # stats::setNames(.x$descr, .x$note) - # }) - # - # vectorSelectInput( - # inputId = ns("type"), - # selected = NULL, - # label = shiny::h4("Plot type"), - # choices = Reduce(c, plots_named), - # multiple = FALSE - # ) - # }), - # shiny::renderUI({ - # shiny::req(input$type) - # - # cols <- c( - # rv$plot.params()[["secondary.extra"]], - # all_but( - # colnames(subset_types( - # data(), - # rv$plot.params()[["secondary.type"]] - # )), - # input$primary - # ) - # ) - # - # columnSelectInput( - # inputId = ns("secondary"), - # data = data, - # selected = cols[1], - # placeholder = "Please select", - # label = if (isTRUE(rv$plot.params()[["secondary.multi"]])) "Additional variables" else "Secondary variable", - # multiple = rv$plot.params()[["secondary.multi"]], - # maxItems = rv$plot.params()[["secondary.max"]], - # col_subset = cols, - # none_label = "No variable" - # ) - # }), - # shiny::renderUI({ - # shiny::req(input$type) - # columnSelectInput( - # inputId = ns("tertiary"), - # data = data, - # placeholder = "Please select", - # label = "Grouping variable", - # multiple = FALSE, - # col_subset = c( - # "none", - # all_but( - # colnames(subset_types( - # data(), - # rv$plot.params()[["tertiary.type"]] - # )), - # input$primary, - # input$secondary - # ) - # ), - # none_label = "No stratification" - # ) - # }) - # )|> setNames(c("primary","type","secondary","tertiary")),keep.null = TRUE) - - output$primary <- shiny::renderUI({ shiny::req(data()) columnSelectInput( @@ -258,13 +153,12 @@ data_visuals_server <- function(id, # shiny::observeEvent(data, { # if (is.null(data()) | NROW(data()) == 0) { - # shiny::updateActionButton(inputId = ns("act_plot"), disabled = TRUE) + # shiny::updateActionButton(inputId = "act_plot", disabled = TRUE) # } else { - # shiny::updateActionButton(inputId = ns("act_plot"), disabled = FALSE) + # shiny::updateActionButton(inputId = "act_plot", disabled = FALSE) # } # }) - output$type <- shiny::renderUI({ shiny::req(input$primary) shiny::req(data()) @@ -610,6 +504,7 @@ supported_plots <- function() { primary.type = c("dichotomous", "categorical"), secondary.type = c("dichotomous", "categorical"), secondary.multi = TRUE, + secondary.extra = NULL, tertiary.type = c("dichotomous", "categorical"), secondary.extra = NULL ) diff --git a/R/hosted_version.R b/R/hosted_version.R index 19c31921..f7e99a89 100644 --- a/R/hosted_version.R +++ b/R/hosted_version.R @@ -1 +1 @@ -hosted_version <- function()'v26.3.5-260330' +hosted_version <- function()'v26.3.6-260331' diff --git a/R/plot_bar.R b/R/plot_bar.R index 909c9edd..f820cc6b 100644 --- a/R/plot_bar.R +++ b/R/plot_bar.R @@ -56,30 +56,12 @@ plot_bar_single <- function(data, pri, sec = NULL, style = c("stack", "dodge", " if (nrow(p_data) > max_level) { - # browser() p_data <- sort_by( p_data, p_data[["Freq"]], decreasing = TRUE ) |> head(max_level) - # if (is.null(sec)){ - # p_data <- sort_by( - # p_data, - # p_data[["Freq"]], - # decreasing=TRUE) |> - # head(max_level) - # } else { - # split(p_data,p_data[[sec]]) |> - # lapply(\(.x){ - # # browser() - # sort_by( - # .x, - # .x[["Freq"]], - # decreasing=TRUE) |> - # head(max_level) - # }) |> dplyr::bind_rows() - # } } ## Shortens long level names diff --git a/R/sysdata.rda b/R/sysdata.rda index e5718750..be267dbf 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/SESSION.md b/SESSION.md index f232def3..ae10ad0a 100644 --- a/SESSION.md +++ b/SESSION.md @@ -4,18 +4,18 @@ |setting |value | |:-----------|:------------------------------------------| |version |R version 4.5.2 (2025-10-31) | -|os |macOS Tahoe 26.3 | +|os |macOS Tahoe 26.4 | |system |aarch64, darwin20 | |ui |RStudio | |language |(EN) | |collate |en_US.UTF-8 | |ctype |en_US.UTF-8 | |tz |Europe/Copenhagen | -|date |2026-03-30 | +|date |2026-03-31 | |rstudio |2026.01.1+403 Apple Blossom (desktop) | |pandoc |3.6.4 @ /opt/homebrew/bin/ (via rmarkdown) | |quarto |1.7.30 @ /usr/local/bin/quarto | -|FreesearchR |26.3.5.260330 | +|FreesearchR |26.3.6.260331 | -------------------------------------------------------------------------------- @@ -84,7 +84,7 @@ |foreach |1.5.2 |2022-02-02 |CRAN (R 4.5.0) | |foreign |0.8-91 |2026-01-29 |CRAN (R 4.5.2) | |Formula |1.2-5 |2023-02-24 |CRAN (R 4.5.0) | -|FreesearchR |26.3.5 |NA |NA | +|FreesearchR |26.3.6 |NA |NA | |fs |1.6.7 |2026-03-06 |CRAN (R 4.5.2) | |gdtools |0.5.0 |2026-02-09 |CRAN (R 4.5.2) | |generics |0.1.4 |2025-05-09 |CRAN (R 4.5.0) | @@ -150,6 +150,7 @@ |pkgload |1.5.0 |2026-02-03 |CRAN (R 4.5.2) | |plyr |1.8.9 |2023-10-02 |CRAN (R 4.5.0) | |polyclip |1.10-7 |2024-07-23 |CRAN (R 4.5.0) | +|polyglotr |1.7.1 |NA |NA | |pracma |2.4.6 |2025-10-22 |CRAN (R 4.5.0) | |processx |3.8.6 |2025-02-21 |CRAN (R 4.5.0) | |promises |1.5.0 |2025-11-01 |CRAN (R 4.5.0) | @@ -187,10 +188,12 @@ |rprojroot |2.1.1 |2025-08-26 |CRAN (R 4.5.0) | |rsconnect |1.7.0 |2025-12-06 |CRAN (R 4.5.2) | |rstudioapi |0.18.0 |2026-01-16 |CRAN (R 4.5.2) | +|rvest |1.0.5 |NA |NA | |S7 |0.2.1 |2025-11-14 |CRAN (R 4.5.2) | |sass |0.4.10 |2025-04-11 |CRAN (R 4.5.0) | |scales |1.4.0 |2025-04-24 |CRAN (R 4.5.0) | |see |0.13.0 |2026-01-30 |CRAN (R 4.5.2) | +|selectr |0.5-1 |NA |NA | |sessioninfo |1.2.3 |2025-02-05 |CRAN (R 4.5.0) | |shiny |1.13.0 |2026-02-20 |CRAN (R 4.5.2) | |shiny.i18n |0.3.0 |2023-01-16 |CRAN (R 4.5.0) | @@ -211,10 +214,13 @@ |tidyselect |1.2.1 |2024-03-11 |CRAN (R 4.5.0) | |timechange |0.4.0 |2026-01-29 |CRAN (R 4.5.2) | |toastui |0.4.0 |2025-04-03 |CRAN (R 4.5.0) | +|triebeard |0.4.1 |NA |NA | |tweenr |2.0.3 |2024-02-26 |CRAN (R 4.5.0) | |twosamples |2.0.1 |2023-06-23 |CRAN (R 4.5.0) | |tzdb |0.5.0 |2025-03-15 |CRAN (R 4.5.0) | +|urltools |1.7.3.1 |NA |NA | |usethis |3.2.1 |2025-09-06 |CRAN (R 4.5.0) | +|utf8 |1.2.6 |2025-06-08 |CRAN (R 4.5.0) | |uuid |1.2-2 |2026-01-23 |CRAN (R 4.5.2) | |vctrs |0.7.1 |2026-01-23 |CRAN (R 4.5.2) | |viridis |0.6.5 |2024-01-29 |CRAN (R 4.5.0) | diff --git a/man/data-plots.Rd b/man/data-plots.Rd index 8f6534f4..6da5a230 100644 --- a/man/data-plots.Rd +++ b/man/data-plots.Rd @@ -21,16 +21,7 @@ \usage{ data_visuals_ui(id, tab_title = "Plots", ...) -data_visuals_server( - id, - data, - palettes = c(`Perceptual (blue-yellow)` = "viridis", `Perceptual (fire)` = "plasma", - `Colour-blind friendly` = "Okabe-Ito", `Qualitative (bold)` = "Dark 2", - `Qualitative (paired)` = "Paired", `Sequential (blues)` = "Blues", - `Diverging (red-blue)` = "RdBu", `Tableau style` = "Tableau 10", Pastel = "Pastel 1", - Rainbow = "rainbow"), - ... -) +data_visuals_server(id, data, palettes, ...) create_plot(data, type, pri, sec, ter = NULL, color.palette = "viridis", ...) @@ -170,7 +161,7 @@ mtcars |> plot_hbars(pri = "carb", sec = "cyl") mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am") mtcars |> plot_hbars(pri = "carb", sec = NULL,color.palette="Blues") mtcars |> plot_hbars(pri = "carb", sec = NULL,color.palette="Magma") -mtcars |> plot_hbars(pri = "carb", sec = NULL,color.palette="Viridis") +mtcars |> plot_hbars(pri = "carb", sec = "am",color.palette="Viridis") mtcars |> plot_likert(pri = "carb", sec = "cyl") mtcars |> plot_likert(pri = "carb", sec = "cyl", ter="am") mtcars |> plot_likert(pri = "cyl",color.palette="Blues") diff --git a/man/vertical_stacked_bars.Rd b/man/vertical_stacked_bars.Rd index 495588fe..75335365 100644 --- a/man/vertical_stacked_bars.Rd +++ b/man/vertical_stacked_bars.Rd @@ -9,7 +9,7 @@ vertical_stacked_bars( score = "full_score", group = "pase_0_q", strata = NULL, - t.size = 10, + t.size = 8, l.color = "black", l.size = 0.5, draw.lines = TRUE,