Last chance! 50% off unlimited learning
Sale ends in
Given the occurrence points in two point processes, this function calculates for each point in the first process, the distance to the nearest occurrence point in the second process.
nearestdist(posx, posy)
Numeric vector. Occurrence times of the points in the first point process.
Numeric vector. Occurrence times of the points in the second point process.
Vector of the distances to the nearest point in the second process for each point in the first process.
The distance between two points
To obtain the vector of nearest points, this function applies to each point in posx
,
the function pdist
, which calculates the distance to its nearest point in posy
.
# NOT RUN {
posx<-c(3,8,23,54,57,82)
posy<-c(2,8,14,16,29,32,45,55,65)
nearestdist(posx, posy)
# }
Run the code above in your browser using DataLab