set.seed(1)
(DFid <- data.frame(
x = sample(1:20,10),
y = sample(1:20,10),
IDs = sapply(1:10,function(i) paste("ID",i,sep=""
require(spdep)
coordinates(DFid) <- ~x+y
coords <- coordinates(DFid)
dnn4 <- dnearneigh(DFid,0,4)
summary(dnn4)
plot(DFid)
plot(dnn4,coords,add=T,col=2)
nb2mat(dnn4,
Dear List,
I have been trying to extract associations from a matrix whereby individual
locations are within a certain distance threshold from one another.
I have been able to extract those individuals where there is 'no interaction'
(i.e. where these individuals are not within a specified dista
2 matches
Mail list logo