prepare_heatmap_data {topolow} | R Documentation |
Generate Distance Matrix Heatmap Data
Description
Prepares distance matrix data for heatmap visualization by handling missing values and calculating relevant statistics.
Usage
prepare_heatmap_data(
distance_matrix,
cluster_rows = FALSE,
cluster_cols = FALSE
)
Arguments
distance_matrix |
Square symmetric matrix of distances |
cluster_rows |
Logical; whether to cluster rows |
cluster_cols |
Logical; whether to cluster columns |
Value
A list of data prepared for generating a heatmap of the distance matrix:
matrix_data |
The distance |
row_order |
An integer vector of the row indices after clustering. If |
col_order |
An integer vector of the column indices after clustering. If |
stats |
A list of summary statistics for the distance matrix, including |
Examples
# Create a sample distance matrix
dist_mat <- matrix(runif(25), 5, 5)
# Prepare data for a heatmap
heatmap_data <- prepare_heatmap_data(dist_mat)
print(heatmap_data$stats$completeness)
[Package topolow version 1.0.0 Index]