mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 01:49:39 +02:00
This commit is contained in:
parent
62b5d7a668
commit
7fceb96a83
3 changed files with 35 additions and 16 deletions
|
@ -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.7.3
|
Version: 25.8.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")),
|
||||||
|
|
7
NEWS.md
7
NEWS.md
|
@ -1,7 +1,12 @@
|
||||||
# FreesearchR 25.7.3 - DEV
|
# FreesearchR 25.8.2 - DEV
|
||||||
|
|
||||||
- *NEW* preparing to automatically only show relevant tabs to simplify interface. NOT IMPLEMENTED YET
|
- *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
|
# FreesearchR 25.7.2
|
||||||
|
|
||||||
- *FIX* refining hiding drop downs. All JavaScript is now in separate file. Coded with GAI help from claude.ai.
|
- *FIX* refining hiding drop downs. All JavaScript is now in separate file. Coded with GAI help from claude.ai.
|
||||||
|
|
|
@ -2364,7 +2364,8 @@ wrap_plot_list <- function(data,
|
||||||
patchwork::wrap_plots(
|
patchwork::wrap_plots(
|
||||||
guides = "collect",
|
guides = "collect",
|
||||||
axes = "collect",
|
axes = "collect",
|
||||||
axis_titles = "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)
|
||||||
|
@ -2400,7 +2401,7 @@ wrap_plot_list <- function(data,
|
||||||
#' @returns list of ggplot2 objects
|
#' @returns list of ggplot2 objects
|
||||||
#' @export
|
#' @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://stackoverflow.com/questions/62818776/get-axis-limits-from-ggplot-object
|
||||||
# https://github.com/thomasp85/patchwork/blob/main/R/plot_multipage.R#L150
|
# https://github.com/thomasp85/patchwork/blob/main/R/plot_multipage.R#L150
|
||||||
if (ggplot2::is_ggplot(..1)) {
|
if (ggplot2::is_ggplot(..1)) {
|
||||||
|
@ -2418,7 +2419,16 @@ align_axes <- function(...) {
|
||||||
xr <- clean_common_axis(p, "x")
|
xr <- clean_common_axis(p, "x")
|
||||||
|
|
||||||
suppressWarnings({
|
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
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5029,7 +5039,7 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) {
|
||||||
na.omit() |>
|
na.omit() |>
|
||||||
plot_euler_single()
|
plot_euler_single()
|
||||||
})
|
})
|
||||||
|
# browser()
|
||||||
# names(out)
|
# names(out)
|
||||||
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")
|
# patchwork::wrap_plots(out, guides = "collect")
|
||||||
|
@ -5087,6 +5097,7 @@ plot_euler_single <- function(data) {
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
#' mtcars |> plot_hbars(pri = "carb", sec = "cyl")
|
#' mtcars |> plot_hbars(pri = "carb", sec = "cyl")
|
||||||
|
#' mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am")
|
||||||
#' mtcars |> plot_hbars(pri = "carb", sec = NULL)
|
#' mtcars |> plot_hbars(pri = "carb", sec = NULL)
|
||||||
plot_hbars <- function(data, pri, sec, ter = NULL) {
|
plot_hbars <- function(data, pri, sec, ter = NULL) {
|
||||||
out <- vertical_stacked_bars(data = data, score = pri, group = sec, strata = ter)
|
out <- vertical_stacked_bars(data = data, score = pri, group = sec, strata = ter)
|
||||||
|
@ -5496,17 +5507,20 @@ plot_violin <- function(data, pri, sec, ter = NULL) {
|
||||||
ds <- list(data)
|
ds <- list(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
out <- lapply(ds, \(.ds){
|
# browser()
|
||||||
rempsyc::nice_violin(
|
suppressWarnings({
|
||||||
data = .ds,
|
out <- lapply(ds, \(.ds){
|
||||||
group = sec,
|
rempsyc::nice_violin(
|
||||||
response = pri,
|
data = .ds,
|
||||||
xtitle = get_label(data, var = sec),
|
group = sec,
|
||||||
ytitle = get_label(data, var = pri)
|
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")
|
# patchwork::wrap_plots(out,guides = "collect")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue