R/nndistG.S

Defines functions nndistG

Documented in nndistG

# Copyright Barry Rowlingson <b.rowlingson@lancaster.ac.uk> and 
# Peter Diggle (c) 1991-3; http://www.maths.lancs.ac.uk/~rowlings/Splancs/
# R port: copyright 1998-2000 by Roger S. Bivand

nndistG <- function(pts)
{
#	library.dynam("splancs","nndist.o")
        storage.mode(pts) <- "double"
	nptsg <- npts(pts)
	neighs <- rep(0,nptsg)
	dists <- rep(0,nptsg)
        storage.mode(dists) <- "double"
	nnlist <- .Fortran("nndisg", t(pts[,1:2]),
	                         as.integer(nptsg),
	                         dists,
				 as.integer(neighs),
				PACKAGE="splancs")
	list(dists=nnlist[[3]],neighs=nnlist[[4]])
}

Try the splancs package in your browser

Any scripts or data that you put into this service are public.

splancs documentation built on May 29, 2024, 6:22 a.m.