paircount: Count the number of point-pairs in distance bins

View source: R/paircount.R

paircountR Documentation

Count the number of point-pairs in distance bins

Description

Count the number of point-pairs in equally spaced distances bins. Code works in any dimension. If only one point set is provided, the distances of this point set with itself are used (counting each pairs only once, i.e. only ij, not ji).

Usage

paircount(x, y = NULL, dr, rmax, cpp = TRUE)

Arguments

x

n-element vector or n-by-d matrix of d-dimensional positions of data points

y

optional m-element vector or m-by-d matrix of d-dimensional positions of a second point set

dr

distance bin size

rmax

maximum distance to be considered

cpp

logical flag; if set to TRUE (default) a fast implementation in C++ is used, otherwise the counting is performed less efficiently in R.

Value

Returns a data frame of two column vectors:

r

mid-points of the distance bins.

n

number of pairs in the distance bin.

Author(s)

Danail Obreschkow

See Also

landyszalay


obreschkow/cooltools documentation built on Nov. 16, 2024, 2:46 a.m.