[R] Beginners Question
Thomas Zastrow
listen at thomas-zastrow.de
Sun Jun 3 13:18:03 CEST 2007
Thank you very much for your answer.
Isn't it possible to tell the isoMDS function that it should ignore
doubled values with the same value? Or is there a possible to delete all
the doubled values from the x.dist?
Best regards,
Tom
Prof Brian Ripley schrieb:
> That two distances are the same is *not* what the message says.
>
> You can't just look at elements of the results of dist() and simply
> relate them back to object numbers. Try as.matrix(x.dist) for a
> human-readable form.
>
>
> On Fri, 1 Jun 2007, Thomas Zastrow wrote:
>
>> 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