diff --git a/CITATION.cff b/CITATION.cff index 7600d6d2..d2716009 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -9,7 +9,7 @@ type: software license: AGPL-3.0-or-later title: 'FreesearchR: A free and open-source browser based data analysis tool for researchers with publication ready output' -version: 25.7.3 +version: 25.7.2 doi: 10.5281/zenodo.14527429 identifiers: - type: url diff --git a/DESCRIPTION b/DESCRIPTION index 7276ef66..002733c6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FreesearchR Title: A free and open-source browser based data analysis tool for researchers with publication ready output -Version: 25.8.1 +Version: 25.7.2 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 fa4f8232..04658d41 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,12 +1,7 @@ -# FreesearchR 25.8.2 - DEV +# FreesearchR 25.7.3 - DEV - *NEW* preparing to automatically only show relevant tabs to simplify interface. NOT IMPLEMENTED YET -# FreesearchR 25.8.1 - -- *NEW* improved the use of `wrap_plot_list()` to pass on additional arguments to `patchwork::wrap_plots()` and allowed to specify axes to align in `align_axes()`. -- *FIX* fixed axis text printed in Euler diagrams - # FreesearchR 25.7.2 - *FIX* refining hiding drop downs. All JavaScript is now in separate file. Coded with GAI help from claude.ai. diff --git a/R/app_version.R b/R/app_version.R index 8583a072..6a80b530 100644 --- a/R/app_version.R +++ b/R/app_version.R @@ -1 +1 @@ -app_version <- function()'25.7.3' +app_version <- function()'25.7.2' diff --git a/R/data_plots.R b/R/data_plots.R index f5b0def3..a751e609 100644 --- a/R/data_plots.R +++ b/R/data_plots.R @@ -738,10 +738,7 @@ line_break <- function(data, lineLength = 20, force = FALSE) { #' @param data list of ggplot2 objects #' @param tag_levels passed to patchwork::plot_annotation if given. Default is NULL #' @param title panel title -#' @param guides passed to patchwork::wrap_plots() -#' @param axes passed to patchwork::wrap_plots() -#' @param axis_titles passed to patchwork::wrap_plots() -#' @param ... passed to patchwork::wrap_plots() +#' @param ... ignored for argument overflow #' #' @returns list of ggplot2 objects #' @export @@ -750,9 +747,6 @@ wrap_plot_list <- function(data, tag_levels = NULL, title = NULL, axis.font.family = NULL, - guides = "collect", - axes = "collect", - axis_titles = "collect", ...) { if (ggplot2::is_ggplot(data[[1]])) { if (length(data) > 1) { @@ -768,10 +762,9 @@ wrap_plot_list <- function(data, })() |> align_axes() |> patchwork::wrap_plots( - guides = guides, - axes = axes, - axis_titles = axis_titles, - ... + guides = "collect", + axes = "collect", + axis_titles = "collect" ) if (!is.null(tag_levels)) { out <- out + patchwork::plot_annotation(tag_levels = tag_levels) @@ -790,17 +783,13 @@ wrap_plot_list <- function(data, cli::cli_abort("Can only wrap lists of {.cls ggplot} objects") } - if (!is.null(axis.font.family)) { - if (inherits(x = out, what = "patchwork")) { - out <- out & - ggplot2::theme(axis.text = ggplot2::element_text(family = axis.font.family)) - } else { - out <- out + - ggplot2::theme(axis.text = ggplot2::element_text(family = axis.font.family)) - } + 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)) } - - out } @@ -811,7 +800,7 @@ wrap_plot_list <- function(data, #' @returns list of ggplot2 objects #' @export #' -align_axes <- function(..., x.axis = TRUE, y.axis = TRUE) { +align_axes <- function(...) { # https://stackoverflow.com/questions/62818776/get-axis-limits-from-ggplot-object # https://github.com/thomasp85/patchwork/blob/main/R/plot_multipage.R#L150 if (ggplot2::is_ggplot(..1)) { @@ -829,16 +818,7 @@ align_axes <- function(..., x.axis = TRUE, y.axis = TRUE) { xr <- clean_common_axis(p, "x") suppressWarnings({ - purrr::map(p, \(.x){ - out <- .x - if (isTRUE(x.axis)) { - out <- out + ggplot2::xlim(xr) - } - if (isTRUE(y.axis)) { - out <- out + ggplot2::ylim(yr) - } - out - }) + p |> purrr::map(~ .x + ggplot2::xlim(xr) + ggplot2::ylim(yr)) }) } diff --git a/R/hosted_version.R b/R/hosted_version.R index 58b72621..4ae8ba6e 100644 --- a/R/hosted_version.R +++ b/R/hosted_version.R @@ -1 +1 @@ -hosted_version <- function()'v25.7.3-250808' +hosted_version <- function()'v25.7.2-250722' diff --git a/R/plot_euler.R b/R/plot_euler.R index e1e48aa8..fc840495 100644 --- a/R/plot_euler.R +++ b/R/plot_euler.R @@ -76,7 +76,6 @@ ggeulerr <- function( #' D = sample(c(TRUE, FALSE, FALSE, FALSE), 50, TRUE) #' ) |> plot_euler("A", c("B", "C"), "D", seed = 4) #' mtcars |> plot_euler("vs", "am", seed = 1) -#' mtcars |> plot_euler("vs", "am", "cyl", seed = 1) plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) { set.seed(seed = seed) if (!is.null(ter)) { @@ -91,9 +90,10 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) { na.omit() |> plot_euler_single() }) -# browser() + + # names(out) wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}")) - # patchwork::wrap_plots(out) + # patchwork::wrap_plots(out, guides = "collect") } #' Easily plot single euler diagrams @@ -123,8 +123,8 @@ plot_euler_single <- function(data) { legend.position = "none", # panel.grid.major = element_blank(), # panel.grid.minor = element_blank(), - axis.text.y = ggplot2::element_blank(), - axis.title.y = ggplot2::element_blank(), + # axis.text.y = element_blank(), + # axis.title.y = element_blank(), text = ggplot2::element_text(size = 20), axis.text = ggplot2::element_blank(), # plot.title = element_blank(), diff --git a/R/plot_hbar.R b/R/plot_hbar.R index 5e13a8e6..deac70c0 100644 --- a/R/plot_hbar.R +++ b/R/plot_hbar.R @@ -7,7 +7,6 @@ #' #' @examples #' mtcars |> plot_hbars(pri = "carb", sec = "cyl") -#' mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am") #' mtcars |> plot_hbars(pri = "carb", sec = NULL) plot_hbars <- function(data, pri, sec, ter = NULL) { out <- vertical_stacked_bars(data = data, score = pri, group = sec, strata = ter) diff --git a/R/plot_violin.R b/R/plot_violin.R index 10ddd8ad..02fbcf11 100644 --- a/R/plot_violin.R +++ b/R/plot_violin.R @@ -14,19 +14,16 @@ plot_violin <- function(data, pri, sec, ter = NULL) { ds <- list(data) } - # browser() - suppressWarnings({ - out <- lapply(ds, \(.ds){ - rempsyc::nice_violin( - data = .ds, - group = sec, - response = pri, - xtitle = get_label(data, var = sec), - ytitle = get_label(data, var = pri) - ) - }) - - wrap_plot_list(out, title = glue::glue("Grouped by {get_label(data,ter)}")) + out <- lapply(ds, \(.ds){ + rempsyc::nice_violin( + data = .ds, + group = sec, + response = pri, + xtitle = get_label(data, var = sec), + ytitle = get_label(data, var = pri) + ) }) + + wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}")) # patchwork::wrap_plots(out,guides = "collect") } diff --git a/R/sysdata.rda b/R/sysdata.rda index b17ce24a..e1ebbdcc 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/SESSION.md b/SESSION.md index 835dc041..1fa73679 100644 --- a/SESSION.md +++ b/SESSION.md @@ -15,7 +15,7 @@ |rstudio |2025.05.0+496 Mariposa Orchid (desktop) | |pandoc |3.6.4 @ /opt/homebrew/bin/ (via rmarkdown) | |quarto |1.7.30 @ /usr/local/bin/quarto | -|FreesearchR |25.7.3.250722 | +|FreesearchR |25.7.2.250722 | -------------------------------------------------------------------------------- @@ -55,7 +55,6 @@ |colorspace |2.1-1 |2024-07-26 |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) | -|credentials |2.0.2 |2024-10-04 |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) | |datamods |1.5.3 |2024-10-02 |CRAN (R 4.4.1) | @@ -88,19 +87,16 @@ |foreach |1.5.2 |2022-02-02 |CRAN (R 4.4.0) | |foreign |0.8-90 |2025-03-31 |CRAN (R 4.4.1) | |Formula |1.2-5 |2023-02-24 |CRAN (R 4.4.1) | -|FreesearchR |25.7.3 |NA |NA | +|FreesearchR |25.7.2 |NA |NA | |fs |1.6.6 |2025-04-12 |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) | -|gert |2.1.5 |2025-03-25 |CRAN (R 4.4.1) | |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) | |ggforce |0.5.0 |2025-06-18 |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) | |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) | |gridExtra |2.3 |2017-09-09 |CRAN (R 4.4.1) | |gt |1.0.0 |2025-04-05 |CRAN (R 4.4.1) | @@ -114,7 +110,6 @@ |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) | |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.0 |2024-04-15 |CRAN (R 4.4.0) | |insight |1.3.1 |2025-06-30 |CRAN (R 4.4.1) | |iterators |1.0.14 |2022-02-05 |CRAN (R 4.4.1) | @@ -210,7 +205,6 @@ |shinyWidgets |0.9.0 |2025-02-21 |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) | -|sys |3.4.3 |2024-10-04 |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) | |textshaping |1.0.1 |2025-05-01 |CRAN (R 4.4.1) | diff --git a/inst/apps/FreesearchR/app.R b/inst/apps/FreesearchR/app.R index 8d19c831..41ec0153 100644 --- a/inst/apps/FreesearchR/app.R +++ b/inst/apps/FreesearchR/app.R @@ -49,7 +49,7 @@ library(rlang) #### Current file: /Users/au301842/FreesearchR/R//app_version.R ######## -app_version <- function()'25.7.3' +app_version <- function()'25.7.2' ######## @@ -2364,8 +2364,7 @@ wrap_plot_list <- function(data, patchwork::wrap_plots( guides = "collect", axes = "collect", - axis_titles = "collect", - ... + axis_titles = "collect" ) if (!is.null(tag_levels)) { out <- out + patchwork::plot_annotation(tag_levels = tag_levels) @@ -2401,7 +2400,7 @@ wrap_plot_list <- function(data, #' @returns list of ggplot2 objects #' @export #' -align_axes <- function(...,x.axis=TRUE,y.axis=TRUE) { +align_axes <- function(...) { # https://stackoverflow.com/questions/62818776/get-axis-limits-from-ggplot-object # https://github.com/thomasp85/patchwork/blob/main/R/plot_multipage.R#L150 if (ggplot2::is_ggplot(..1)) { @@ -2419,16 +2418,7 @@ align_axes <- function(...,x.axis=TRUE,y.axis=TRUE) { xr <- clean_common_axis(p, "x") suppressWarnings({ - purrr::map(p, \(.x){ - out <- .x - if (isTRUE(x.axis)){ - out <- out + ggplot2::xlim(xr) - } - if (isTRUE(y.axis)){ - out <- out + ggplot2::ylim(yr) - } - out - }) + p |> purrr::map(~ .x + ggplot2::xlim(xr) + ggplot2::ylim(yr)) }) } @@ -4036,7 +4026,7 @@ simple_snake <- function(data){ #### Current file: /Users/au301842/FreesearchR/R//hosted_version.R ######## -hosted_version <- function()'v25.7.3-250808' +hosted_version <- function()'v25.7.2-250722' ######## @@ -5039,7 +5029,7 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) { na.omit() |> plot_euler_single() }) -# browser() + # names(out) wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}")) # patchwork::wrap_plots(out, guides = "collect") @@ -5097,7 +5087,6 @@ plot_euler_single <- function(data) { #' #' @examples #' mtcars |> plot_hbars(pri = "carb", sec = "cyl") -#' mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am") #' mtcars |> plot_hbars(pri = "carb", sec = NULL) plot_hbars <- function(data, pri, sec, ter = NULL) { out <- vertical_stacked_bars(data = data, score = pri, group = sec, strata = ter) @@ -5507,20 +5496,17 @@ plot_violin <- function(data, pri, sec, ter = NULL) { ds <- list(data) } - # browser() - suppressWarnings({ - out <- lapply(ds, \(.ds){ - rempsyc::nice_violin( - data = .ds, - group = sec, - response = pri, - xtitle = get_label(data, var = sec), - ytitle = get_label(data, var = pri) - ) - }) - - wrap_plot_list(out, title = glue::glue("Grouped by {get_label(data,ter)}")) + out <- lapply(ds, \(.ds){ + rempsyc::nice_violin( + data = .ds, + group = sec, + response = pri, + xtitle = get_label(data, var = sec), + ytitle = get_label(data, var = pri) + ) }) + + wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}")) # patchwork::wrap_plots(out,guides = "collect") } diff --git a/man/align_axes.Rd b/man/align_axes.Rd index 2a8ab279..01a43a3b 100644 --- a/man/align_axes.Rd +++ b/man/align_axes.Rd @@ -4,7 +4,7 @@ \alias{align_axes} \title{Aligns axes between plots} \usage{ -align_axes(..., x.axis = TRUE, y.axis = TRUE) +align_axes(...) } \arguments{ \item{...}{ggplot2 objects or list of ggplot2 objects} diff --git a/man/data-plots.Rd b/man/data-plots.Rd index cf0cfff2..9a612c1d 100644 --- a/man/data-plots.Rd +++ b/man/data-plots.Rd @@ -111,7 +111,6 @@ mtcars |> plot_box_single("mpg") mtcars |> plot_box_single("mpg","cyl") gtsummary::trial |> plot_box_single("age","trt") mtcars |> plot_hbars(pri = "carb", sec = "cyl") -mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am") mtcars |> plot_hbars(pri = "carb", sec = NULL) mtcars |> default_parsing() |> diff --git a/man/plot_euler.Rd b/man/plot_euler.Rd index b4bc1b2d..2785047a 100644 --- a/man/plot_euler.Rd +++ b/man/plot_euler.Rd @@ -31,5 +31,4 @@ data.frame( D = sample(c(TRUE, FALSE, FALSE, FALSE), 50, TRUE) ) |> plot_euler("A", c("B", "C"), "D", seed = 4) mtcars |> plot_euler("vs", "am", seed = 1) -mtcars |> plot_euler("vs", "am", "cyl", seed = 1) } diff --git a/man/wrap_plot_list.Rd b/man/wrap_plot_list.Rd index 2a6e8d62..bc291dfb 100644 --- a/man/wrap_plot_list.Rd +++ b/man/wrap_plot_list.Rd @@ -9,9 +9,6 @@ wrap_plot_list( tag_levels = NULL, title = NULL, axis.font.family = NULL, - guides = "collect", - axes = "collect", - axis_titles = "collect", ... ) } @@ -22,13 +19,7 @@ wrap_plot_list( \item{title}{panel title} -\item{guides}{passed to patchwork::wrap_plots()} - -\item{axes}{passed to patchwork::wrap_plots()} - -\item{axis_titles}{passed to patchwork::wrap_plots()} - -\item{...}{passed to patchwork::wrap_plots()} +\item{...}{ignored for argument overflow} } \value{ list of ggplot2 objects