Learn R Programming

IndTestPP (version 3.0)

nearestdist: Distance to the nearest point

Description

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.

Usage

nearestdist(posx, posy)

Arguments

posx

Numeric vector. Occurrence times of the points in the first point process.

posy

Numeric vector. Occurrence times of the points in the second point process.

Value

Vector of the distances to the nearest point in the second process for each point in the first process.

Details

The distance between two points \(x_i\) and \(y_i\) in a point process in time, is the absolute value of their difference: \(|x_i-y_i|\).

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.

See Also

DutilleulPlot

Examples

Run this code
# 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