Hello all, I'm using R1.7.1 on Linux, generating sammon-optimized MDS plots from distance matrices. This is a calculation I run routinely, often on sample sets of up to 100 samples. This time, with three samples, the sammon function returned an error (shown below), which I tracked down to the cmdscale function it uses to find a starting configuration. In short, cmdscale is returning NaN values for the second-dimension coordinates. I was able to sidestep this problem by adding the following line to the sammon code, in order to give a default configuration under this circumstance. y[!is.finite(y)] <- 0 The result is no errors and the three points lined up along one axis. I'm guessing that the problem has to do with the small distance between samples 2 and 3 -- that cmdscale is trying to find coordinates for two things are essentially on the same spot (within its level of precision). My question is whether anyone else has seen this problem, and is this the best way to solve it? Many thanks, Janet Manry Initial distance matrix: ===============[1,] 0.00000000 0.080600084 0.075761312 [2,] 0.08060008 0.000000000 0.004737846 [3,] 0.07576131 0.004737846 0.000000000 Function call: ===========coordinates <- sammon(newDmat,trace=FALSE)$points Error message: ==============Error in sammon(newDmat, trace = FALSE) : NA/NaN/Inf in foreign function call (arg 4) In addition: Warning messages: 1: some of the first2eigenvalues are < 0 in: cmdscale(d, k) 2: NaNs produced in: sqrt(ev) Output from using just cmdscale on the same distance matrix, printing eigen values and vectors: ================== $points [,1] [,2] [1,] 0.05212395 NaN [2,] -0.02847993 NaN [3,] -0.02364402 NaN $eig [1] 4.087052e-03 -6.088049e-20 $x NULL $ac [1] 0 $GOF [1] 1 1 Warning messages: 1: some of the first2eigenvalues are < 0 in: cmdscale(newDmat, eig TRUE) 2: NaNs produced in: sqrt(ev) Applying La.eigen to the same distance matrix =================================$values [1] 0.113015163 -0.004734047 -0.108281116 $vectors [,1] [,2] [,3] [1,] 0.6995002 -0.002659579 0.7146275 [2,] 0.5194820 -0.684822933 -0.5110342 [3,] 0.4907524 0.728704657 -0.4776522 ===================Janet Manry, M.S. Bioinformatics/Development Bacterial BarCodes, Inc. Houston, TX USA jmanry at bacbarcodes.com