mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
plots new accept pri, sec and ter arguments instead of x,y,z to avoid confusion. tests, tests, tests
This commit is contained in:
parent
e463fa0670
commit
652a8ca1b7
28 changed files with 3275 additions and 179 deletions
|
|
@ -76,16 +76,16 @@ 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)
|
||||
plot_euler <- function(data, x, y, z = NULL, seed = 2103) {
|
||||
plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) {
|
||||
set.seed(seed = seed)
|
||||
if (!is.null(z)) {
|
||||
ds <- split(data, data[z])
|
||||
if (!is.null(ter)) {
|
||||
ds <- split(data, data[ter])
|
||||
} else {
|
||||
ds <- list(data)
|
||||
}
|
||||
|
||||
out <- lapply(ds, \(.x){
|
||||
.x[c(x, y)] |>
|
||||
.x[c(pri, sec)] |>
|
||||
as.data.frame() |>
|
||||
plot_euler_single()
|
||||
})
|
||||
|
|
@ -95,7 +95,6 @@ plot_euler <- function(data, x, y, z = NULL, seed = 2103) {
|
|||
# patchwork::wrap_plots(out, guides = "collect")
|
||||
}
|
||||
|
||||
?withCallingHandlers()
|
||||
#' Easily plot single euler diagrams
|
||||
#'
|
||||
#' @returns ggplot2 object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue