Yes thanks that works…
library (spdep)
m<-dist(rnorm(10))
mds<-cmdscale(m,k=2)
plot(mds)
print(knearneigh(mds,3)$nn)

On 23/06/2012, at 4:25 AM, Robert J. Hijmans wrote:

> How about multidimensional scaling? With distance matrix m you could do
> 
> mds <- cmdscale(m)
> p <- mds$points
> 
> and then use the euclidean distances between the points in p to get the nearest neighbors.
> 
> Robert
> 
> On Fri, Jun 22, 2012 at 9:03 AM, Roger Bivand <Roger.Bivand@nhh.no> wrote:
> On Fri, 22 Jun 2012, Nevil Amos wrote:
> 
> Is it possible to derive a network - say x nearest neighbours form a cost distance matrix ( i.e. square matrix of calculated cost distances between points?
> 
> the inverse of spdep nb2mat ?
> 
> ?mat2listw maybe?
> 
> Roger
> 
> 
> thanks
> 
> Nevil Amos
> 
> -- 
> Roger Bivand
> Department of Economics, NHH Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivand@nhh.no
> 
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 


	[[alternative HTML version deleted]]

