nnid: Find the id of nearest neighbour for each point.

Description Usage Arguments Value Author(s) Examples

Description

Find the id of nearest neighbour for each point in a point pattern by specific numbers or circular neighborhood.

Usage

1
nnid(X, N = NULL, R = NULL, id, exclude = TRUE)

Arguments

X

A marked point pattern (object of class "ppp").

N

Specific number of points in the neighborhood, the value is always assinged 4.

R

Specific circular neighborhood, the value is always assinged 5.

id

Specific identification number of each row in the point pattern.

exclude

Wether including id of core points, if exclude is TRUE the result return the data removed the id of core points, if exclude is FALSE the result return the data with the id of core points.

Value

id of nearest neighbour for each point

Author(s)

Zongzheng Chai, chaizz@126.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(spatstat)
data(finpines)
#Find the id of the nearest neighbour in a certain numbers and without id
finpines.rmidN4<-nnid(finpines,id=paste("T",1:finpines$n),N=4)
finpines.rmidN4

#Find the id of the nearest neighbour in a certain numbers with id
finpines.idN4<-nnid(finpines,id=paste("T",1:finpines$n),N=4,exclude=FALSE)
finpines.idN4

#Find the id of the nearest neighbour within a certain radius without id
finpines.rmidR0.5<-nnid(tree.ppp,id=paste("T",1:41),R=0.5)
finpines.rmidR0.5

#Find the id of the nearest neighbour within a certain radius with id
finpines.idR0.5<-nnid(tree.ppp,id=paste("T",1:41),R=0.5,exclude=FALSE)
finpines.idR0.5

Zongzheng/forestSAS documentation built on May 10, 2019, 1:59 a.m.