Re: [R] help me understand how things work.

2010-09-16 Thread Mario Valle
s Alex *From:* Mario Valle *To:* Alaios *Sent:* Thu, September 16, 2010 1:28:31 PM *Subject:* Re: [R] help me understand how things work. ?dist BTW, to me this does not happens. x <- matrix(rnorm(100), nrow=5) d <- dist(x) 1/sqrt(d) 1/sqrt(dist(x)) H

Re: [R] help me understand how things work.

2010-09-16 Thread Alaios
, 2010 1:28:31 PM Subject: Re: [R] help me understand how things work. ?dist BTW, to me this does not happens. x <- matrix(rnorm(100), nrow=5) d <- dist(x) 1/sqrt(d) 1/sqrt(dist(x)) Hope it helps mario On 16-Sep-10 12:02, Alaios wrote: > Hello I ha

Re: [R] help me understand how things work.

2010-09-16 Thread Julian Burgos
Hi Alex, What is happening is that the ´dist´function calculates a distance matrix, and returns an object of the ´dist´ class. > temp <- rbind (c(10,1),c(99,98)) > x=dist(temp) > x 1 2 131.6435 > class(x) [1] "dist" You can see a description of the ´dist´class at the end of the function

Re: [R] help me understand how things work.

2010-09-16 Thread Michael Bedward
Hello Alex, Look at the help page for the dist function. You'll see it doesn't return a simple vector or matrix, rather a "dist" class object which is why you got a surprise when you tried to treat it like a simple value. The function is not really intended for spatial point distance calculations,