nndist.ppx(spatstat)
nndist.ppx()所属R语言包:spatstat
Nearest Neighbour Distances in Any Dimensions
在任何尺寸的近邻距离
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the distance from each point to its nearest neighbour in a multi-dimensional point pattern. Alternatively computes the distance to the second nearest neighbour, or third nearest, etc.
计算从每个点的距离,其在一个多维的点图案的近邻。或者计算的距离,所述第二近邻,或第三最近等
用法----------Usage----------
## S3 method for class 'ppx'
nndist(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----------
This function computes the Euclidean distance from each point in a multi-dimensional point pattern to its nearest neighbour (the nearest other point of the pattern). If k is specified, it computes the distance to the kth nearest neighbour.
该函数计算从一个多维点图案中的每个点的欧几里得距离其最近的邻居(最接近的其他点的图案)。如果k指定,计算距离的的k日最近的邻居。
The function nndist is generic; this function nndist.ppx is the method for the class "ppx".
函数nndist是通用的,,此功能nndist.ppx的方法是类"ppx"。
The argument k may be a single integer, or an integer vector. If it is a vector, then the kth nearest neighbour distances are computed for each value of k specified in the vector.
参数k可能是一个整数或整数向量。如果它是一个向量,然后k个近邻距离k向量中指定的每个值的计算。
If there is only one point (if x has length 1), then a nearest neighbour distance of Inf is returned. If there are no points (if x has length zero) a numeric vector of length zero is returned.
如果只有一个点(如果x具有长度为1),那么一个近邻距离Inf被返回。如果没有点(如果x长度为零的)返回长度为零的一个数值向量。
To identify which point is the nearest neighbour of a given point, use nnwhich.
要确定哪个点是一个给定的点最近的邻居,使用nnwhich。
To find the nearest neighbour distances 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 containing the nearest neighbour distances for each point.
包含近邻的每个点的距离的数值向量或矩阵。
If k = 1 (the default), the return value is a numeric vector v such that v[i] is the nearest neighbour distance for the ith data point.
如果k = 1(默认值),则返回值是一个数值向量v这样v[i]的i个数据点的距离是最近的邻居。
If k is a single integer, then the return value is a numeric vector v such that v[i] is the kth nearest neighbour distance for the ith data point.
如果k是一个整数,则返回值是一个数值向量v等v[i]是k日的最近邻距离i日数据点。
If k is a vector, then the return value is a matrix m such that m[i,j] is the k[j]th nearest neighbour distance for the ith data point.
如果k是一个向量,则返回值是一个矩阵m等m[i,j]是k[j]日最近的邻居i个数据点的距离。
警告----------Warnings----------
An infinite or NA value is returned if the distance is not defined (e.g. 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----------
nndist, pairdist, nnwhich
nndist,pairdist,nnwhich
实例----------Examples----------
df <- data.frame(x=runif(5),y=runif(5),z=runif(5),w=runif(5))
X <- ppx(data=df)
# nearest neighbours[最近的邻居]
d <- nndist(X)
# second nearest neighbours[次近邻]
d2 <- nndist(X, k=2)
# first, second and third nearest[第一,第二和第三最近]
d1to3 <- nndist(X, k=1:3)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|