bigheat: High-dimensional cluster distance heat matrix

Description Usage Arguments Value Author(s) See Also Examples

View source: R/bigheat.R

Description

This function takes a data frame of instances characterized by cluster IDs, condenses the instance vectors, creates a distance matrix between each instance grouped by cluster, and visualizes the clustering using a heat map color gradient from very similar (i.e. blue; low distance) to very dissimilar (i.e. red; high distance).

Usage

1
bigheat(df, order_diag = FALSE, merge = 10, dist_metric = "euclidean", legend = "Distance", axislabs = "Condensed Distance Vectors", title = "Cluster Differentiation", interactive = FALSE)

Arguments

df

(REQUIRED) Data frame containing numeric features and a cluster ID column. Cluster ID column must be labelled "Cluster" and contain exclusive cluster IDs of type numeric, integer, or factor.

order_diag

(OPTIONAL) Boolean argument of whether or not to order the diagonal of the final heat matrix. A ordered diagonal will order the gradient of instances within each cluster, thus highlighting how much of each cluster is very similar or very different.

merge

(OPTIONAL) Numeric argument of how many instance vectors to condense for the heat map visualization (e.g. 10,000 rows with merge = 10 corresponds to 1,000 instances in the heat map).

dist_metric

(OPTIONAL) Character argument of what method to use for measuring distance between instances. Arguments are limited to those provided in the dist base-function, which include "euclidean", "maximum", "Manhattan", "Canberra", "binary" and "Malinowski".

legend

(OPTIONAL) Character argument of the plot legend title.

axislabs

(OPTIONAL) Character argument of the plot axis labels (note: one argument)

title

(OPTIONAL) Character argument of the plot title.

interactive

(OPTIONAL) Logical argument to enable plotly's ggplotly function.

Value

A ggplot instance-level distance matrix heat map visualization.

Author(s)

Derek Lukacsko & Jonathan Bourne

See Also

bigextract, summaryheat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Data frame of features
df <- iris[,c(1:3)]

# Create clusters
k = 3
fit <- kmeans(df, k)

# Append cluster memebership to instance vectors
df$Cluster = fit$cluster

# Visualize using bigheat
bigheat(df, order_diag = TRUE, merge = 1)

lukadw11/Clusty documentation built on May 21, 2019, 8:57 a.m.