1 Jul 18:25
Spatial Statistics
Dear list members,
I'm working in a spatial analysis field, and i built a code for estimated the nearest distance among two
circles. The problem is that this circles have an area and "the real distance" is among the boundaries of
this circles. As you can see in the code below, i saw that i corrected this problem but in the last part, and i
have to do it in the first part.
Thank you very much in advance.
Best,
Isaac
####### Nearest Neighbours ##########
NearestNeighbours<-function(data,pos){
require(fields)
d<-data[pos,]
posiciones<-d[,1:2]
area<-data[,3]
D<-rdist(posiciones,posiciones)
diag(D)<-NA
out<-NULL
for(i in 1:nrow(D)){
index<-which.min(D[i,])[1]
nn<-d[index,1:2]
radio1<-sqrt(d[index,3]/pi)
(Continue reading)
RSS Feed