nearestdist: Distance to the nearest point

Description Usage Arguments Details Value See Also Examples

View source: R/nearestdist.R

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

1
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.

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.

Value

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

See Also

DutilleulPlot

Examples

1
2
3
posx<-c(3,8,23,54,57,82)
posy<-c(2,8,14,16,29,32,45,55,65)
nearestdist(posx, posy)

IndTestPP documentation built on Aug. 29, 2020, 1:06 a.m.