找回密码
 注册
查看: 289|回复: 0

R语言 spatstat包 nncross()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 13:50:05 | 显示全部楼层 |阅读模式
nncross(spatstat)
nncross()所属R语言包:spatstat

                                        Nearest Neighbours Between Two Patterns
                                         两个模式之间最近的邻居

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Given two point patterns X and Y, finds the nearest neighbour in Y of each point of X. Alternatively Y may be a line segment pattern.
给定两个点模式X和Y,找到最近的邻居在Y每个点的X。或者Y可以是线段图案。


用法----------Usage----------


  nncross(X, Y, iX=NULL, iY=NULL,
          what = c("dist", "which"),
          ...,
          sortby=c("range", "var", "x", "y"),
          is.sorted.X = FALSE,
          is.sorted.Y = FALSE)



参数----------Arguments----------

参数:X
Point pattern (object of class "ppp").
点模式(类的对象"ppp")。


参数:Y
Either a point pattern (object of class "ppp") or a line segment pattern (object of class "psp").
无论是点模式(类的对象"ppp")或的线段模式(对象类"psp")。


参数:iX, iY
Optional identifiers, applicable only in the case where Y is a point pattern, used to determine whether a point in X is identical to a point in Y. See Details.  
可选的标识符,只适用的情况下,Y是一个点的图案,用来确定一个点是否在X是相同的一个点,Y。查看详细信息。


参数:what
Character string specifying what information should be returned. Either the nearest neighbour distance ("dist"), the identifier of the nearest neighbour ("which"), or both.  
指定什么样的信息应该返回的字符串。近邻距离(要么"dist"),该标识符的近邻("which"),或两者兼而有之。


参数:sortby
Determines which coordinate to use to sort the point patterns. See Details.  
确定用来排序的点模式相协调。查看详细信息。


参数:is.sorted.X, is.sorted.Y
Logical values attesting whether the point patterns X and Y have been sorted. See Details.  
逻辑值,证明点模式是否X和Y已排序。查看详细信息。


参数:...
Ignored.
忽略。


Details

详细信息----------Details----------

Given two point patterns X and Y this function finds, for each point of X,  the nearest point of Y. The distance between these points is also computed.
由于两个点模式X和Y此功能发现,每一个点的X,最近点Y。在这些点之间的距离也被计算。

Alternatively if X is a point pattern and Y is a line segment pattern, the function finds the nearest line segment to each point of X, and computes the distance.
或者,如果X是一个点图案和Y是线段图案,该函数发现最接近的线段到每个点X,并计算距离。

The return value is a data frame, with rows corresponding to the points of X.  The first column gives the nearest neighbour distances (i.e. the ith entry is the distance  from the ith point of X to the nearest element of Y). The second column gives the indices of the nearest neighbours (i.e.\ the ith entry is the index of the nearest element in Y.) If what="dist" then only the vector of distances is returned. If what="which" then only the vector of indices is returned.
返回值是一个数据框,行对应的点X。第一列给出的近邻的距离(即i:个条目的距离从iXth点至最近的元素Y)。第二列给出的指标(即\i个条目是在Y最近的元素的索引。)如果what="dist"的距离向量,则返回最近的邻居。如果what="which"然后返回矢量指数。

Note that this function is not symmetric in X and Y. To find the nearest neighbour in X of each point in Y, where Y is a point pattern, use nncross(Y,X).
注意,这个函数是不是对称的X和Y。要找到最近的邻居在X中的每个点Y,其中Y是一个点模式,使用nncross(Y,X)。

The arguments iX and iY are used when the two point patterns X and Y have some points in common.  In this situation nncross(X, Y) would return some zero distances. To avoid this, attach a unique integer identifier to each point, such that two points are identical if their identifying numbers are equal. Let iX be the vector of identifier values for the points in X, and iY the vector of identifiers for points in Y. Then the code will only compare two points if they have different values of the identifier. See the Examples.
的参数iX和iY使用时的两个点模式X和Y有一些共同点。在这种情况下nncross(X, Y)将返回一些零距离。为了避免这种情况,一个唯一的整数标识符附加到每个点,例如,两个点是相同的,如果它们的识别号码是相等的。让我们iX的标识符值是矢量的点X和iY矢量标识符点Y的。“然后,该代码将只能比较两个点,如果它们具有不同的标识符的值。请参阅范例。


值----------Value----------

By default (if what=c("dist", "which")) a data frame with two columns:
默认情况下(如果what=c("dist", "which"))数据框有两列:


参数:dist
Nearest neighbour distance
最近邻距离


参数:which
Nearest neighbour index in Y
最近邻指数在Y

If what="dist", a vector of nearest neighbour distances.
如果what="dist",最近邻的矢量的距离。

If what="which", a vector of nearest neighbour indices.
如果what="which",向量的近邻指数。


对数据进行排序和预排序的数据----------Sorting data and pre-sorted data----------

For efficiency, the algorithm sorts the point patterns X and Y into increasing order of the x coordinate or increasing order of the the y coordinate. By default (if sortby="range"), the sorting will occur on the coordinate that has the larger range of values (according to the frame of the enclosing window of Y). If sortby = "var"), sorting will occur on the coordinate that has the greater variance (in the pattern Y). Setting sortby="x" or sortby = "y" will specify that sorting should occur on the x or y coordinate, respectively.
为了提高效率,算法的各种点模式X和Y的增加,为了x坐标或增加的y坐标顺序的。默认情况下(如果sortby="range"),排序会发生有更大范围的值(根据帧的包围窗口Y)上的坐标,该坐标。如果sortby = "var"),排序将有更大的差异(在该模式中的坐标发生Y“)。设置sortby="x"或sortby = "y"指定排序应该发生在x或y协调,分别。

If the point pattern X is already sorted, then the corresponding argument is.sorted.X should be set to TRUE, and sortby should be set equal to "x" or "y" to indicate which coordinate is sorted.
如果点模式X已经排序,那么相应的参数is.sorted.X应设置为TRUE,和sortby应等于"x"或 "y"坐标进行排序。

Similarly if Y is already sorted, then is.sorted.Y should be set to TRUE, and sortby should be set equal to "x" or "y" to indicate which coordinate is sorted.
同样,如果Y已经排序,然后is.sorted.Y应设置为TRUE,sortby应设置等于"x"或"y"坐标进行排序。

If both X and Y are sorted on the same coordinate axis then both is.sorted.X and is.sorted.Y should be set to TRUE, and sortby should be set equal to "x" or "y" to indicate which coordinate is sorted.  
如果这两个X和Y相同的坐标轴上进行排序,然后两个is.sorted.X和is.sorted.Y应设置为TRUE,sortby应该可以设置等于"x"或"y"坐标进行排序。


(作者)----------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>,
Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>,
and Jens Oehlschlaegel




参见----------See Also----------

nndist for nearest neighbour distances in a single point pattern.
nndist最近的邻居的距离,在单点模式。


实例----------Examples----------


  # two different point patterns[两个不同的点模式]
  X <- runifpoint(15)
  Y <- runifpoint(20)
  N <- nncross(X,Y)$which
  # note that length(N) = 15[请注意,长度(N)= 15]
  plot(superimpose(X=X,Y=Y), main="nncross", cols=c("red","blue"))
  arrows(X$x, X$y, Y[N]$x, Y[N]$y, length=0.15)

  # two patterns with some points in common[两种模式与共同的一些点]
  Z <- runifpoint(50)
  X <- Z[1:30]
  Y <- Z[20:50]
  iX <- 1:30
  iY <- 20:50
  N <- nncross(X,Y, iX, iY)$which
  N &lt;- nncross(X,Y, iX, iY, what="which") #faster[快]
  plot(superimpose(X=X, Y=Y), main="nncross", cols=c("red","blue"))
  arrows(X$x, X$y, Y[N]$x, Y[N]$y, length=0.15)

  # point pattern and line segment pattern[点模式和线段模式]
  X <- runifpoint(15)
  Y <- rpoisline(10)
  N <- nncross(X,Y)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-15 23:08 , Processed in 0.020817 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表