FreesearchR/man/plot_sankey_single.Rd

28 lines
870 B
Text
Raw Normal View History

2025-03-05 21:13:06 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R
\name{plot_sankey_single}
\alias{plot_sankey_single}
\title{Beautiful sankey plot}
\usage{
2025-03-11 13:42:57 +01:00
plot_sankey_single(data, x, y, color.group = c("x", "y"), colors = NULL, ...)
2025-03-05 21:13:06 +01:00
}
\arguments{
2025-03-11 13:42:57 +01:00
\item{color.group}{set group to colour by. "x" or "y".}
\item{colors}{optinally specify colors. Give NA color, color for each level
in primary group and color for each level in secondary group.}
\item{...}{passed to sankey_ready()}
2025-03-05 21:13:06 +01:00
}
\value{
ggplot2 object
}
\description{
Beautiful sankey plot
}
\examples{
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")
}