slanted_reorder: Reorder data rows and columns to move high values close to...

Description Usage Arguments Value Examples

View source: R/slanter.R

Description

Given a matrix expressing the cross-similarity between two (possibly different) sets of entities, this uses slanted_orders to compute the "best" order for visualizing the matrix, then returns the reordered data. Commonly used in pheatmap(slanted_reorder(data), ...), and of course sheatmap does this internally for you.

Usage

1
2
3
4
5
6
7
8
9
slanted_reorder(
  data,
  order_data = NULL,
  order_rows = TRUE,
  order_cols = TRUE,
  squared_order = TRUE,
  same_order = FALSE,
  discount_outliers = TRUE
)

Arguments

data

A rectangular matrix to reorder, of non-negative values (unless order_data is specified).

order_data

An optional matrix of non-negative values of the same size to use for computing the orders.

order_rows

Whether to reorder the rows.

order_cols

Whether to reorder the columns.

squared_order

Whether to reorder to minimize the l2 norm (otherwise minimizes the l1 norm).

same_order

Whether to apply the same order to both rows and columns.

discount_outliers

Whether to do a final order phase discounting outlier values far from the diagonal.

Value

A matrix of the same shape whose rows and columns are a permutation of the input.

Examples

1

slanter documentation built on May 9, 2021, 9:07 a.m.