Order layout observations based on weights
Usage
align_order(
wts = rowMeans,
...,
reverse = FALSE,
strict = TRUE,
data = NULL,
set_context = FALSE,
name = NULL
)
Arguments
- wts
A summary function which accepts a data and returns the weights for each observations. Alternatively, you can provide an ordering index as either an integer or a character. Since characters have been designated as character indices, if you wish to specify a function name as a string, you must enclose it with
I()
.- ...
<dyn-dots> Additional arguments passed to function provided in
wts
argument.- reverse
A boolean value. Should the sort order be in reverse?
- strict
A boolean value indicates whether the order should be strict. If previous groups has been established, and strict is
FALSE
, this will reorder the observations in each group.- data
A matrix, data frame, or a simple vector. If an atomic vector is provided, it will be converted into a one-column matrix. When
data = NULL
, the internallayout
data will be used by default. Additionally,data
can be a function (including purrr-like lambdas), which will be applied to thelayout
data.It is important to note that we consider the
rows
as the observations. It means theNROW(data)
must return the same number with the specificlayout
axis (meaning the x-axis for vertical stack layout, or y-axis for horizontal stack layout).heatmap_layout()
: for column annotation, thelayout
data will be transposed before using (If data is afunction
, it will be applied with the transposed matrix). This is necessary because column annotation uses heatmap columns as observations, but we need rows.stack_layout()
: thelayout
data will be used as it is since we place all plots along a single axis.
- set_context
A single boolean value indicates whether to set the active context to current plot. If
TRUE
, all subsequent ggplot elements will be added into this plot.- name
A string of the plot name. Used to switch the active context in
hmanno()
orstack_active()
.