The stack_align
function aligns observations, while stack_free
does not.
Several aliases are provided for convenience:
stack_alignv
: A special case ofstack_align
that setsdirection = "vertical"
.stack_alignh
: A special case ofstack_align
that setsdirection = "horizontal"
.stack_freev
: A special case ofstack_free
that setsdirection = "vertical"
.stack_freeh
: A special case ofstack_free
that setsdirection = "horizontal"
.
Usage
stack_align(data = NULL, direction = NULL, ..., theme = NULL, sizes = NA)
stack_alignv(data = NULL, ...)
stack_alignh(data = NULL, ...)
stack_free(data = NULL, direction = NULL, ..., theme = NULL, sizes = NA)
stack_freev(data = NULL, ...)
stack_freeh(data = NULL, ...)
Arguments
- data
Default dataset to use for the layout. If not specified, it must be supplied in each plot added to the layout. By default, it will try to inherit from parent layout:
For
stack_free
,fortify_data_frame()
will be used to convert data to a data frame.For
stack_align
,fortify_matrix()
will be used to convert data to a matrix.
- direction
A string indicating the direction of the stack layout, either
"horizontal"
or"vertical"
.- ...
Additional arguments passed to
fortify_data_frame()
orfortify_matrix()
.- theme
A
theme()
used to render theguides
,title
,subtitle
,caption
,margins
,patch.title
,panel.border
, andbackground
. IfNULL
(default), will inherit from the parentlayout
.- sizes
A numeric or a
unit
object of length3
indicating the relative heights (fordirection = "horizontal"
) or widths (fordirection = "vertical"
).
Examples
set.seed(123)
stack_align(matrix(rnorm(56), nrow = 7L), "h") +
align_dendro()