R/neighbCount.R

Defines functions neighbCount2d neighbCount3d

Documented in neighbCount2d neighbCount3d

# Neighbours count from 2D data

neighbCount2d <- function(x, y, radius = 0.05)
{
  apply(
    distMatr2d(x, y), 
    1, 
    function(x, rd){length(x[x <= rd])}, 
    radius)
}

# Neighbours count from 3D data
neighbCount3d <- function(x, y, z, radius = 0.05)
{
  apply(
    distMatr3d(x, y, z), 
    1, 
    function(x, rd){length(x[x <= rd])}, 
    radius)
}
xyzallan/TLSforest documentation built on Oct. 10, 2019, 3:49 a.m.