[R] Beginners Question
Thomas Zastrow
listen at thomas-zastrow.de
Fri Jun 1 21:23:18 CEST 2007
Dear all,
I'm completely new to R and at first I must say that it is a great program!
But I have a problem with the function isoMDS from the MASS package. I
have this code which I load with source() from a file:
x <- c(163.59514923926784, 150.01448475257115, ...... {here are some
more values})
x.sort <- sort(x)
x.dist <- dist(x.sort)
library(MASS)
x.mds <- isoMDS(x.dist)
plot(x.mds$points, type="n")
text(x.mds$points, labels=as.character("x"))
The problem is in the line where the isoMDS function is applied: I got
the error:
Fehler in isoMDS(x.dist) : zero or negative distance between objects 9
and 10
When I look at values 8 and 9 of x.dist, I see that they have the same
values (I'm not wrong, it's values of 8 and 9 and not 9 and 10):
x.dist[8:9]
[1] 39.8214 39.8214
So, just to give'm a try, I changed the value of x.dist[8]:
x.dist[8] <- c(39.7)
Now, there are defintitely different values in this part of x.dist:
x.dist[7:10]
[1] 39.69898 39.70000 39.82140 39.98892
But when I start isoMDS again, I got again the error:
x.mds <- isoMDS(x.dist)
Fehler in isoMDS(x.dist) : zero or negative distance between objects 9
and 10
So, where's my error?
Thank you!
Best,
Tom
--
----------------------------
http://www.thomas-zastrow.de
German Forum - DTP under Linux:
http://www.opendtp.de
More information about the R-help
mailing list