Infrastructure for ordering objects with an implementation of several
seriation/sequencing/ordination techniques to reorder matrices, dissimilarity
matrices, and dendrograms. Also provides (optimally) reordered heatmaps,
color images and clustering visualizations like dissimilarity plots, and
visual assessment of cluster tendency plots (VAT and iVAT). Hahsler et al (2008)
This package provides the infrastructure for seriation with an implementation of several seriation/sequencing techniques to reorder matrices, dissimilarity matrices, and dendrograms (see below for a full list). Also provides (optimally) reordered heatmaps, color images and clustering visualizations like dissimilarity plots, and visual assessment of cluster tendency plots (VAT and iVAT).
Stable CRAN version: install from within R with
install.packages("seriation")
Current development version: Download package from AppVeyor or install from GitHub (needs devtools).
library("devtools")install_github("mhahsler/seriation")
Load library, read data and calculate distances. Then use default seriation.
library(seriation)data("iris")x <- as.matrix(iris[-5])x <- x[sample(1:nrow(x)),] d <- dist(x)order <- seriate(d)order
object of class ‘ser_permutation’, ‘list’
contains permutation vectors for 1-mode data
vector length seriation method
1 150 ARSA
Compare quality.
rbind( random = criterion(d), reordered = criterion(d, order))
AR_events AR_deviations RGAR Gradient_raw Gradient_weighted Path_length
random 550620 948833.712 0.49938328 741 -1759.954 392.77766
reordered 54846 9426.094 0.04974243 992214 1772123.418 83.95758
Inertia Least_squares ME Moore_stress Neumann_stress 2SUM LS
random 214602194 78852819 291618.0 927570.00 461133.357 29954845 5669489
reordered 356945979 76487641 402332.1 13593.32 5274.093 17810802 4486900
For dissimilarity data:
For matrices: