[R] distance matrix
vydramail at quick.cz
Sun Jan 20 22:27:02 CET 2008
Wow, thank you all for advice, I'll have to get more familiar with R. The
dist() fuction is probably the right way.
Erin Hodgess-2 wrote:
> Suppose you have:
>> x <- runif(25)
>> y <- rnorm(25)
>> x.df <- data.frame(x,y)
> The default is euclidean distance.
> Hope this helps!
> On Jan 20, 2008 2:41 PM, WCD <vydramail at quick.cz> wrote:
>> Hello, I want do get the point to point distance matrix.
>> Suppose, I have a data frame where the first column is X and second
>> is Y coordinate of points.
>> I define a function dst(x1,y1,x2,y2) to claculate distance between two
>> points. But I don't know how to tell R to calculate dst for every two
>> and create a matrix of these distances.
>> Can you give me a little guidance, please? I am quite new to R and
>> Thanks for every advice. Filip Kral.
>> View this message in context:
>> Sent from the R help mailing list archive at Nabble.com.
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: erinm.hodgess at gmail.com
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
View this message in context: http://www.nabble.com/distance-matrix-tp14986595p14987085.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help