mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 01:49:39 +02:00
This commit is contained in:
parent
7fceb96a83
commit
67cfc31304
7 changed files with 95 additions and 74 deletions
|
@ -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.8.1
|
||||
doi: 10.5281/zenodo.14527429
|
||||
identifiers:
|
||||
- type: url
|
||||
|
|
|
@ -1 +1 @@
|
|||
app_version <- function()'25.7.3'
|
||||
app_version <- function()'25.8.1'
|
||||
|
|
|
@ -1 +1 @@
|
|||
hosted_version <- function()'v25.7.3-250808'
|
||||
hosted_version <- function()'v25.8.1-250808'
|
||||
|
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
31
SESSION.md
31
SESSION.md
|
@ -11,11 +11,11 @@
|
|||
|collate |en_US.UTF-8 |
|
||||
|ctype |en_US.UTF-8 |
|
||||
|tz |Europe/Copenhagen |
|
||||
|date |2025-07-22 |
|
||||
|date |2025-08-08 |
|
||||
|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.8.1.250808 |
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -26,8 +26,6 @@
|
|||
|apexcharter |0.4.4 |2024-09-06 |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) |
|
||||
|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) |
|
||||
|base64enc |0.1-3 |2015-07-28 |CRAN (R 4.4.1) |
|
||||
|bayestestR |0.16.1 |2025-07-01 |CRAN (R 4.4.1) |
|
||||
|
@ -45,7 +43,6 @@
|
|||
|cardx |0.2.5 |2025-07-03 |CRAN (R 4.4.1) |
|
||||
|caTools |1.18.3 |2024-09-04 |CRAN (R 4.4.1) |
|
||||
|cellranger |1.1.0 |2016-07-27 |CRAN (R 4.4.0) |
|
||||
|cffr |1.2.0 |2025-01-25 |CRAN (R 4.4.1) |
|
||||
|checkmate |2.3.2 |2024-07-29 |CRAN (R 4.4.0) |
|
||||
|class |7.3-23 |2025-01-01 |CRAN (R 4.4.1) |
|
||||
|classInt |0.4-11 |2025-01-08 |CRAN (R 4.4.1) |
|
||||
|
@ -55,8 +52,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) |
|
||||
|datawizard |1.2.0 |2025-07-17 |CRAN (R 4.4.1) |
|
||||
|
@ -65,7 +60,6 @@
|
|||
|devtools |2.4.5 |2022-10-11 |CRAN (R 4.4.0) |
|
||||
|DHARMa |0.4.7 |2024-10-18 |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) |
|
||||
|dplyr |1.1.4 |2023-11-17 |CRAN (R 4.4.0) |
|
||||
|DT |0.33 |2024-04-04 |CRAN (R 4.4.0) |
|
||||
|
@ -88,19 +82,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.8.1 |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,13 +105,11 @@
|
|||
|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) |
|
||||
|jquerylib |0.1.4 |2021-04-26 |CRAN (R 4.4.0) |
|
||||
|jsonlite |2.0.0 |2025-03-27 |CRAN (R 4.4.1) |
|
||||
|jsonvalidate |1.5.0 |2025-02-07 |CRAN (R 4.4.1) |
|
||||
|KernSmooth |2.23-26 |2025-01-01 |CRAN (R 4.4.1) |
|
||||
|keyring |1.4.1 |2025-06-15 |CRAN (R 4.4.1) |
|
||||
|knitr |1.50 |2025-03-16 |CRAN (R 4.4.1) |
|
||||
|
@ -128,11 +117,9 @@
|
|||
|later |1.4.2 |2025-04-08 |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) |
|
||||
|litedown |0.7 |2025-04-08 |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) |
|
||||
|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) |
|
||||
|Matrix |1.7-3 |2025-03-11 |CRAN (R 4.4.1) |
|
||||
|memoise |2.0.1 |2021-11-26 |CRAN (R 4.4.0) |
|
||||
|
@ -147,7 +134,6 @@
|
|||
|opdisDownsampling |1.0.1 |2024-04-15 |CRAN (R 4.4.0) |
|
||||
|openssl |2.3.3 |2025-05-26 |CRAN (R 4.4.1) |
|
||||
|openxlsx2 |1.17 |2025-07-04 |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) |
|
||||
|patchwork |1.3.1 |2025-06-21 |CRAN (R 4.4.1) |
|
||||
|pbmcapply |1.5.1 |2022-04-28 |CRAN (R 4.4.1) |
|
||||
|
@ -159,6 +145,7 @@
|
|||
|pkgload |1.4.0 |2024-06-28 |CRAN (R 4.4.0) |
|
||||
|plyr |1.8.9 |2023-10-02 |CRAN (R 4.4.1) |
|
||||
|polyclip |1.10-7 |2024-07-23 |CRAN (R 4.4.1) |
|
||||
|polylabelr |0.3.0 |2024-11-19 |CRAN (R 4.4.1) |
|
||||
|pracma |2.4.4 |2023-11-10 |CRAN (R 4.4.1) |
|
||||
|processx |3.8.6 |2025-02-21 |CRAN (R 4.4.1) |
|
||||
|profvis |0.4.0 |2024-09-20 |CRAN (R 4.4.1) |
|
||||
|
@ -169,10 +156,13 @@
|
|||
|qqconf |1.3.2 |2023-04-14 |CRAN (R 4.4.0) |
|
||||
|qqplotr |0.0.6 |2023-01-25 |CRAN (R 4.4.0) |
|
||||
|quarto |1.4.4 |2024-07-20 |CRAN (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) |
|
||||
|ragg |1.4.0 |2025-04-10 |CRAN (R 4.4.1) |
|
||||
|rankinPlot |1.1.0 |2023-01-30 |CRAN (R 4.4.0) |
|
||||
|rappdirs |0.3.3 |2021-01-31 |CRAN (R 4.4.1) |
|
||||
|rbibutils |2.3 |2024-10-04 |CRAN (R 4.4.1) |
|
||||
|RColorBrewer |1.1-3 |2022-04-03 |CRAN (R 4.4.1) |
|
||||
|Rcpp |1.1.0 |2025-07-02 |CRAN (R 4.4.1) |
|
||||
|
@ -203,14 +193,13 @@
|
|||
|see |0.11.0 |2025-03-11 |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) |
|
||||
|shiny2docker |0.0.3 |2025-06-28 |CRAN (R 4.4.1) |
|
||||
|shinybusy |0.3.3 |2024-03-09 |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) |
|
||||
|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) |
|
||||
|styler |1.10.3 |2024-04-07 |CRAN (R 4.4.0) |
|
||||
|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) |
|
||||
|
@ -226,7 +215,6 @@
|
|||
|urlchecker |1.0.1 |2021-11-30 |CRAN (R 4.4.1) |
|
||||
|usethis |3.1.0 |2024-11-26 |CRAN (R 4.4.1) |
|
||||
|uuid |1.2-1 |2024-07-29 |CRAN (R 4.4.1) |
|
||||
|V8 |6.0.4 |2025-06-04 |CRAN (R 4.4.1) |
|
||||
|vctrs |0.6.5 |2023-12-01 |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) |
|
||||
|
@ -235,5 +223,4 @@
|
|||
|xml2 |1.3.8 |2025-03-14 |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) |
|
||||
|yesno |0.1.3 |2024-07-26 |CRAN (R 4.4.1) |
|
||||
|zip |2.3.3 |2025-05-13 |CRAN (R 4.4.1) |
|
||||
|
|
|
@ -49,7 +49,7 @@ library(rlang)
|
|||
#### Current file: /Users/au301842/FreesearchR/R//app_version.R
|
||||
########
|
||||
|
||||
app_version <- function()'25.7.2'
|
||||
app_version <- function()'25.8.1'
|
||||
|
||||
|
||||
########
|
||||
|
@ -2338,7 +2338,10 @@ 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 ... ignored for argument overflow
|
||||
#' @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()
|
||||
#'
|
||||
#' @returns list of ggplot2 objects
|
||||
#' @export
|
||||
|
@ -2347,6 +2350,9 @@ 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) {
|
||||
|
@ -2362,9 +2368,10 @@ wrap_plot_list <- function(data,
|
|||
})() |>
|
||||
align_axes() |>
|
||||
patchwork::wrap_plots(
|
||||
guides = "collect",
|
||||
axes = "collect",
|
||||
axis_titles = "collect"
|
||||
guides = guides,
|
||||
axes = axes,
|
||||
axis_titles = axis_titles,
|
||||
...
|
||||
)
|
||||
if (!is.null(tag_levels)) {
|
||||
out <- out + patchwork::plot_annotation(tag_levels = tag_levels)
|
||||
|
@ -2383,13 +2390,17 @@ wrap_plot_list <- function(data,
|
|||
cli::cli_abort("Can only wrap lists of {.cls ggplot} objects")
|
||||
}
|
||||
|
||||
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))
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
|
||||
|
@ -2400,7 +2411,7 @@ wrap_plot_list <- function(data,
|
|||
#' @returns list of ggplot2 objects
|
||||
#' @export
|
||||
#'
|
||||
align_axes <- function(...) {
|
||||
align_axes <- function(..., x.axis = TRUE, y.axis = TRUE) {
|
||||
# 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)) {
|
||||
|
@ -2418,7 +2429,16 @@ align_axes <- function(...) {
|
|||
xr <- clean_common_axis(p, "x")
|
||||
|
||||
suppressWarnings({
|
||||
p |> purrr::map(~ .x + ggplot2::xlim(xr) + ggplot2::ylim(yr))
|
||||
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
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -4026,7 +4046,7 @@ simple_snake <- function(data){
|
|||
#### Current file: /Users/au301842/FreesearchR/R//hosted_version.R
|
||||
########
|
||||
|
||||
hosted_version <- function()'v25.7.2-250722'
|
||||
hosted_version <- function()'v25.8.1-250808'
|
||||
|
||||
|
||||
########
|
||||
|
@ -5015,6 +5035,7 @@ 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)) {
|
||||
|
@ -5029,10 +5050,9 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) {
|
|||
na.omit() |>
|
||||
plot_euler_single()
|
||||
})
|
||||
|
||||
# names(out)
|
||||
# browser()
|
||||
wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}"))
|
||||
# patchwork::wrap_plots(out, guides = "collect")
|
||||
# patchwork::wrap_plots(out)
|
||||
}
|
||||
|
||||
#' Easily plot single euler diagrams
|
||||
|
@ -5062,8 +5082,8 @@ plot_euler_single <- function(data) {
|
|||
legend.position = "none",
|
||||
# panel.grid.major = element_blank(),
|
||||
# panel.grid.minor = element_blank(),
|
||||
# axis.text.y = element_blank(),
|
||||
# axis.title.y = element_blank(),
|
||||
axis.text.y = ggplot2::element_blank(),
|
||||
axis.title.y = ggplot2::element_blank(),
|
||||
text = ggplot2::element_text(size = 20),
|
||||
axis.text = ggplot2::element_blank(),
|
||||
# plot.title = element_blank(),
|
||||
|
@ -5087,6 +5107,7 @@ 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)
|
||||
|
@ -5496,17 +5517,20 @@ plot_violin <- function(data, pri, sec, ter = NULL) {
|
|||
ds <- list(data)
|
||||
}
|
||||
|
||||
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)
|
||||
)
|
||||
})
|
||||
# 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)}"))
|
||||
wrap_plot_list(out, title = glue::glue("Grouped by {get_label(data,ter)}"))
|
||||
})
|
||||
# patchwork::wrap_plots(out,guides = "collect")
|
||||
}
|
||||
|
||||
|
|
|
@ -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.8.1'
|
||||
|
||||
|
||||
########
|
||||
|
@ -2338,7 +2338,10 @@ 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 ... ignored for argument overflow
|
||||
#' @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()
|
||||
#'
|
||||
#' @returns list of ggplot2 objects
|
||||
#' @export
|
||||
|
@ -2347,6 +2350,9 @@ 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) {
|
||||
|
@ -2362,9 +2368,9 @@ wrap_plot_list <- function(data,
|
|||
})() |>
|
||||
align_axes() |>
|
||||
patchwork::wrap_plots(
|
||||
guides = "collect",
|
||||
axes = "collect",
|
||||
axis_titles = "collect",
|
||||
guides = guides,
|
||||
axes = axes,
|
||||
axis_titles = axis_titles,
|
||||
...
|
||||
)
|
||||
if (!is.null(tag_levels)) {
|
||||
|
@ -2384,13 +2390,17 @@ wrap_plot_list <- function(data,
|
|||
cli::cli_abort("Can only wrap lists of {.cls ggplot} objects")
|
||||
}
|
||||
|
||||
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))
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
|
||||
|
@ -2401,7 +2411,7 @@ wrap_plot_list <- function(data,
|
|||
#' @returns list of ggplot2 objects
|
||||
#' @export
|
||||
#'
|
||||
align_axes <- function(...,x.axis=TRUE,y.axis=TRUE) {
|
||||
align_axes <- function(..., x.axis = TRUE, y.axis = TRUE) {
|
||||
# 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,12 +2429,12 @@ align_axes <- function(...,x.axis=TRUE,y.axis=TRUE) {
|
|||
xr <- clean_common_axis(p, "x")
|
||||
|
||||
suppressWarnings({
|
||||
purrr::map(p, \(.x){
|
||||
purrr::map(p, \(.x){
|
||||
out <- .x
|
||||
if (isTRUE(x.axis)){
|
||||
if (isTRUE(x.axis)) {
|
||||
out <- out + ggplot2::xlim(xr)
|
||||
}
|
||||
if (isTRUE(y.axis)){
|
||||
if (isTRUE(y.axis)) {
|
||||
out <- out + ggplot2::ylim(yr)
|
||||
}
|
||||
out
|
||||
|
@ -4036,7 +4046,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.8.1-250808'
|
||||
|
||||
|
||||
########
|
||||
|
@ -5025,6 +5035,7 @@ 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)) {
|
||||
|
@ -5040,9 +5051,8 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) {
|
|||
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")
|
||||
# patchwork::wrap_plots(out)
|
||||
}
|
||||
|
||||
#' Easily plot single euler diagrams
|
||||
|
@ -5072,8 +5082,8 @@ plot_euler_single <- function(data) {
|
|||
legend.position = "none",
|
||||
# panel.grid.major = element_blank(),
|
||||
# panel.grid.minor = element_blank(),
|
||||
# axis.text.y = element_blank(),
|
||||
# axis.title.y = element_blank(),
|
||||
axis.text.y = ggplot2::element_blank(),
|
||||
axis.title.y = ggplot2::element_blank(),
|
||||
text = ggplot2::element_text(size = 20),
|
||||
axis.text = ggplot2::element_blank(),
|
||||
# plot.title = element_blank(),
|
||||
|
|
Loading…
Add table
Reference in a new issue