[R] sammon fails with duplicates error, but no duplicates there (MASS package)

Martin Guetlein guetlein at informatik.uni-freiburg.de
Fri Jul 4 09:12:42 CEST 2014


Hi all,

the sammon mapping fails with message "initial configuration has
duplicates". But there are no duplicates in my data (see example
below).
Apparently, the problem is that row 9 and 10 have an equal distance to
all other rows (but they are not equal, see last two columns).

Any help to get sammon working would be great,
Kind regards,
Martin


library("MASS")
c1 <- c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0)
c2 <- c(0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0)
c3 <- c(1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0)
c4 <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0)
c5 <- c(1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0)
c6 <- c(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 0, 0)
c7 <- c(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0)
c8 <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0)
c9 <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0)
c10<- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1)
# working
data <- rbind(c1,c2,c3,c4,c5,c6,c7,c8,c9)
sammon(dist(data))
# not working:
data <- rbind(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10)
sammon(dist(data))



More information about the R-help mailing list