minor steps
Some checks are pending
pkgdown.yaml / pkgdown (push) Waiting to run

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-03-12 18:27:46 +01:00
commit efc3f8acc3
No known key found for this signature in database
23 changed files with 1467 additions and 644 deletions

View file

@ -13,7 +13,8 @@ columnSelectInput(
col_subset = NULL,
placeholder = "",
onInitialize,
none_label = "No variable selected"
none_label = "No variable selected",
maxItems = NULL
)
}
\arguments{
@ -34,6 +35,8 @@ columnSelectInput(
\item{onInitialize}{passed to \code{\link[shiny]{selectizeInput}} options}
\item{none_label}{label for "none" item}
\item{maxItems}{max number of items}
}
\value{
a \code{\link[shiny]{selectizeInput}} dropdown element

View file

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R
% Please edit documentation in R/data_plots.R, R/plot_sankey.R
\name{data-plots}
\alias{data-plots}
\alias{plot_ridge}
@ -9,7 +9,7 @@
\alias{plot_scatter}
\alias{sankey_ready}
\alias{plot_sankey}
\title{Title}
\title{Plot nice ridge plot}
\usage{
plot_ridge(data, x, y, z = NULL, ...)
@ -21,7 +21,7 @@ plot_violin(data, x, y, z = NULL)
plot_scatter(data, x, y, z = NULL)
sankey_ready(data, x, y, z = NULL, numbers = "count")
sankey_ready(data, x, y, numbers = "count", ...)
plot_sankey(data, x, y, z = NULL, color.group = "x", colors = NULL)
}
@ -54,7 +54,7 @@ data.frame
ggplot2 object
}
\description{
Title
Plot nice ridge plot
Wrapper to create plot based on provided type
@ -81,6 +81,12 @@ mtcars |> plot_scatter(x = "mpg", y = "wt")
ds <- data.frame(g = sample(LETTERS[1:2], 100, TRUE), first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)), last = sample(c(letters[1:4], NA), 100, TRUE, prob = c(rep(.23, 4), .08)))
ds |> sankey_ready("first", "last")
ds |> sankey_ready("first", "last", numbers = "percentage")
data.frame(
g = sample(LETTERS[1:2], 100, TRUE),
first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)),
last = sample(c(TRUE, FALSE, FALSE), 100, TRUE)
) |>
sankey_ready("first", "last")
ds <- data.frame(g = sample(LETTERS[1:2], 100, TRUE), first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)), last = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)))
ds |> plot_sankey("first", "last")
ds |> plot_sankey("first", "last", color.group = "y")

24
man/ggeulerr.Rd Normal file
View file

@ -0,0 +1,24 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_euler.R
\name{ggeulerr}
\alias{ggeulerr}
\title{Area proportional venn diagrams}
\usage{
ggeulerr(combinations, show_quantities = TRUE, show_labels = TRUE, ...)
}
\arguments{
\item{combinations}{set relationships as a named numeric vector, matrix, or
data.frame(See \code{eulerr::euler})}
\item{show_quantities}{whether to show number of intersecting elements}
\item{show_labels}{whether to show set names}
\item{...}{further arguments passed to eulerr::euler}
}
\description{
THis is slightly modified from https://gist.github.com/danlooo/d23d8bcf8856c7dd8e86266097404ded
This functions uses eulerr::euler to plot area proportional venn diagramms
but plots it using ggplot2
}

View file

@ -22,5 +22,5 @@ Line breaking at given number of characters for nicely plotting labels
}
\examples{
"Lorem ipsum... you know the routine" |> line_break()
paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(fixed=TRUE)
paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(fixed = TRUE)
}

20
man/missing_fraction.Rd Normal file
View file

@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{missing_fraction}
\alias{missing_fraction}
\title{Get missingsness fraction}
\usage{
missing_fraction(data)
}
\arguments{
\item{data}{data}
}
\value{
numeric vector
}
\description{
Get missingsness fraction
}
\examples{
c(NA,1:10,rep(NA,3)) |> missing_fraction()
}

34
man/plot_euler.Rd Normal file
View file

@ -0,0 +1,34 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_euler.R
\name{plot_euler}
\alias{plot_euler}
\title{Easily plot euler diagrams}
\usage{
plot_euler(data, x, y, z = NULL, seed = 2103)
}
\arguments{
\item{data}{data}
\item{x}{name of main variable}
\item{y}{name of secondary variables}
\item{z}{grouping variable}
\item{seed}{seed}
}
\value{
patchwork object
}
\description{
Easily plot euler diagrams
}
\examples{
data.frame(
A = sample(c(TRUE, TRUE, FALSE), 50, TRUE),
B = sample(c("A", "C"), 50, TRUE),
C = sample(c(TRUE, FALSE, FALSE, FALSE), 50, TRUE),
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)
}

23
man/plot_euler_single.Rd Normal file
View file

@ -0,0 +1,23 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_euler.R
\name{plot_euler_single}
\alias{plot_euler_single}
\title{Easily plot single euler diagrams}
\usage{
plot_euler_single(data)
}
\value{
ggplot2 object
}
\description{
Easily plot single euler diagrams
}
\examples{
data.frame(
A = sample(c(TRUE, TRUE, FALSE), 50, TRUE),
B = sample(c("A", "C"), 50, TRUE),
C = sample(c(TRUE, FALSE, FALSE, FALSE), 50, TRUE),
D = sample(c(TRUE, FALSE, FALSE, FALSE), 50, TRUE)
) |> plot_euler_single()
mtcars[c("vs", "am")] |> plot_euler_single()
}

View file

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R
% Please edit documentation in R/plot_sankey.R
\name{plot_sankey_single}
\alias{plot_sankey_single}
\title{Beautiful sankey plot}
@ -24,4 +24,10 @@ Beautiful sankey plot
ds <- data.frame(g = sample(LETTERS[1:2], 100, TRUE), first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)), last = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)))
ds |> plot_sankey_single("first", "last")
ds |> plot_sankey_single("first", "last", color.group = "y")
data.frame(
g = sample(LETTERS[1:2], 100, TRUE),
first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)),
last = sample(c(TRUE, FALSE, FALSE), 100, TRUE)
) |>
plot_sankey_single("first", "last", color.group = "x")
}