| gglasagna | R Documentation |
tfs using ggplot2Lasagna plots show one color bar for each function.
gglasagna(
data,
tf,
order = NULL,
label = NULL,
arg = NULL,
order_by = NULL,
order_ticks = TRUE
)
data |
A data frame containing the |
tf |
bare name of the |
order |
(optional) bare name of a column in |
label |
(optional) bare name of a column in |
arg |
|
order_by |
a function applied to each row in |
order_ticks |
add horizontal lines indicating borders between levels of
|
The vertical order of the lasagna layers is increasing in
order (if provided),
the values returned by order_by (if provided),
and the row number of the observations.
i.e., lowest values are on top so that by default the first layer is the first
observation in data and the vertical order of the layers is the
ordering of observations obtained by dplyr::arrange(data, order, order_by(value), row_number()).
a ggplot2 object
Other tidyfun visualization:
autoplot.tf(),
ggcapellini,
ggspaghetti
library(ggplot2)
set.seed(1221)
data <- expand.grid(group = factor(1:5), rep = 1:10)
data <- dplyr::mutate(data,
id = paste(group, rep, sep = "-"),
f = tf_rgp(50),
fb = tfb(f)
)
gglasagna(data, f, label = id)
gglasagna(data, fb, label = id, order = group)
# order is lowest first / on top by default
gglasagna(data, f, label = id, order = tf_depth(f))
gglasagna(data, f, label = id, order_by = dplyr::first) +
facet_wrap(~group, scales = "free")
# order of layers is by "order_by" within "order":
gglasagna(data, fb, label = id, order = group, order_by = dplyr::first)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.