library(seriation)

Note: this requires at least version 1.1-0 of seriation (http://r-forge.r-project.org/R/?group_id=141)

data(iris)

shuffle the data set

iris <- iris[sample(1:nrow(iris)),]

head(iris)
##     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species
## 62           5.9         3.0          4.2         1.5 versicolor
## 88           6.3         2.3          4.4         1.3 versicolor
## 38           4.9         3.6          1.4         0.1     setosa
## 91           5.5         2.6          4.4         1.2 versicolor
## 115          5.8         2.8          5.1         2.4  virginica
## 69           6.2         2.2          4.5         1.5 versicolor
plot(iris[,-5], col=iris[,5])

compute Eucliden distance on scaled data. Col 5 is the class attribute. Note that in the paper they do not scale the data, but normalize it between 0 and 1.

d <- dist(scale(iris[,-5]))

Matrix shading

pimage(d, key=TRUE)