mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 01:49:39 +02:00
fefat: fixed Euler plotting without axis text
This commit is contained in:
parent
ca65bca2f8
commit
62b5d7a668
5 changed files with 18 additions and 6 deletions
|
@ -76,6 +76,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)) {
|
||||
|
@ -90,10 +91,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
|
||||
|
@ -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 = 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(),
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#'
|
||||
#' @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)
|
||||
|
|
|
@ -111,6 +111,7 @@ 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() |>
|
||||
|
|
|
@ -31,4 +31,5 @@ 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)
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@ wrap_plot_list(
|
|||
tag_levels = NULL,
|
||||
title = NULL,
|
||||
axis.font.family = NULL,
|
||||
guides = "collect",
|
||||
axes = "collect",
|
||||
axis_titles = "collect",
|
||||
...
|
||||
)
|
||||
}
|
||||
|
@ -19,7 +22,13 @@ wrap_plot_list(
|
|||
|
||||
\item{title}{panel title}
|
||||
|
||||
\item{...}{ignored for argument overflow}
|
||||
\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()}
|
||||
}
|
||||
\value{
|
||||
list of ggplot2 objects
|
||||
|
|
Loading…
Add table
Reference in a new issue