nnwhich.ppx(spatstat)
nnwhich.ppx()所属R语言包:spatstat
Nearest Neighbours in Any Dimensions
最近的邻居在任何尺寸
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Finds the nearest neighbour of each point in a multi-dimensional point pattern.
查找一个多维的点图案中的每个点的近邻。
用法----------Usage----------
## S3 method for class 'ppx'
nnwhich(X, ..., k=1)
参数----------Arguments----------
参数:X
Multi-dimensional point pattern (object of class "ppx").
三维多点模式(类的对象"ppx")。
参数:...
Arguments passed to coords.ppx to determine which coordinates should be used.
参数传递给coords.ppx,以确定应该使用的坐标。
参数:k
Integer, or integer vector. The algorithm will compute the distance to the kth nearest neighbour.
整数或整数向量。该算法计算距离的的k日最近的邻居。
Details
详细信息----------Details----------
For each point in the given multi-dimensional point pattern, this function finds its nearest neighbour (the nearest other point of the pattern). By default it returns a vector giving, for each point, the index of the point's nearest neighbour. If k is specified, the algorithm finds each point's kth nearest neighbour.
对于给定的多维点图案中的每个点,此功能发现其近邻(最接近的其他点的图案)。默认情况下,它返回一个向量的付出,每一个点,该指数点的近邻。如果k指定的算法发现各点的k日最近的邻居。
The function nnwhich is generic. This is the method for the class "ppx".
函数nnwhich是通用的。这个方法类"ppx"。
If there are no points in the pattern, a numeric vector of length zero is returned. If there is only one point, then the nearest neighbour is undefined, and a value of NA is returned. In general if the number of points is less than or equal to k, then a vector of NA's is returned.
如果没有点的格局,返回长度为零的一个数值向量。如果只有一个点,那么最近的邻居是不确定的,并返回值NA。一般来说,如果点的数量小于或等于k,然后一个向量的NAs的返回。
To evaluate the distance between a point and its nearest neighbour, use nndist.
为了评估一个点之间的距离和离它最近的邻居,使用nndist。
To find the nearest neighbours from one point pattern to another point pattern, use nncross.
要找到最近的邻居模式从一个点到另一个点的模式,使用nncross。
By default, both spatial and temporal coordinates are extracted. To obtain the spatial distance between points in a space-time point pattern, set temporal=FALSE.
默认情况下,空间和时间坐标中提取。为了获得点之间的空间距离,空间的时间点模式,设置temporal=FALSE。
值----------Value----------
Numeric vector or matrix giving, for each point, the index of its nearest neighbour (or kth nearest neighbour).
数字向量或矩阵,每一个点,给其最近的邻居(或k日最近的邻居)的索引。
If k = 1 (the default), the return value is a numeric vector v giving the indices of the nearest neighbours (the nearest neighbout of the ith point is the jth point where j = v[i]).
如果k = 1(默认值),则返回值是一个数值向量v给近邻指数(最近neighbout i个点是j个点j = v[i]“)。
If k is a single integer, then the return value is a numeric vector giving the indices of the kth nearest neighbours.
如果k是一个整数,则返回值是一个数值向量k日最近的邻居给的指标。
If k is a vector, then the return value is a matrix m such that m[i,j] is the index of the k[j]th nearest neighbour for the ith data point.
如果k是一个向量,则返回值是一个矩阵mm[i,j]是该指数的k[j]日最近的邻居i日数据点。
警告----------Warnings----------
A value of NA is returned if there is only one point in the point pattern.
返回值NA如果只有一个点的点模式。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
参见----------See Also----------
nnwhich, nndist, nncross
nnwhich,nndist,nncross
实例----------Examples----------
df <- data.frame(x=runif(5),y=runif(5),z=runif(5),w=runif(5))
X <- ppx(data=df)
m <- nnwhich(X)
m2 <- nnwhich(X, k=2)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|