Re: [R] shortest distance between two point pattern

2008-02-09 Thread huber
PS: > ...For larger problems, there are more efficient nearest neighbor > search algorithms, but I am not aware whether or where in R. The 'but' subclause was wrong, one place to look at is the "yaImpute" package and also this thread: http://tolstoy.newcastle.edu.au/R/e4/devel/08/01/0158.html

Re: [R] shortest distance between two point pattern

2008-02-09 Thread huber
Dear Miltinho, there is also the function "matchpt" in the Biobase package (in Bioconductor) that seems to do what you want (in n dimensions). It's written in C, and the implementation is simple and of complexity n*m. (For larger problems, there are more efficient nearest neighbor search algor

Re: [R] shortest distance between two point pattern

2008-02-08 Thread Bill.Venables
au/bill.venables/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Grothendieck Sent: Saturday, 9 February 2008 2:47 PM To: Milton Cezar Ribeiro Cc: R-help Subject: Re: [R] shortest distance between two point pattern Try using dist: ix <- 1:nrow(df.

Re: [R] shortest distance between two point pattern

2008-02-08 Thread Gabor Grothendieck
Try using dist: ix <- 1:nrow(df.1) m <- as.matrix(dist(rbind(df.1, df.2)))[ix, -ix] which(min(m) == m, arr = TRUE) On Feb 8, 2008 11:01 PM, Milton Cezar Ribeiro <[EMAIL PROTECTED]> wrote: > Hi R-experts. > > I am working in a R-code where I have two datasets with x and y coordinates > on each

[R] shortest distance between two point pattern

2008-02-08 Thread Milton Cezar Ribeiro
Hi R-experts. I am working in a R-code where I have two datasets with x and y coordinates on each dataset. I intent to identify the shortest distance between this two datasets. I wrote a short code to do that. But when I join the datasets to compute the distances, the merge function run so slo