Re: [R] Beginners Question

From: Thomas Zastrow <listen_at_thomas-zastrow.de>
Date: Sun, 03 Jun 2007 13:18:03 +0200

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

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 03 Jun 2007 - 11:26:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 03 Jun 2007 - 12:31:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.