matchpt(Biobase)
matchpt()所属R语言包:Biobase
Nearest neighbor search.
近邻搜索。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Find the nearest neighbors of a set of query points in the same or another set of points in an n-dimensional real vector space, using the Euclidean distance.
找到一套查询点最近的邻居在同一或另一组在一个n维实向量空间点,使用欧氏距离。
用法----------Usage----------
matchpt(x, y)
参数----------Arguments----------
参数:x
A matrix (or vector) of coordinates. Each row represents a point in an ncol(x)-dimensional real vector space.
一个坐标矩阵(或向量)。每一行代表了一个ncol(x)维实向量空间的点。
参数:y
Optional, matrix (or vector) with the same number of columns as x.
可选的,矩阵(或向量)相同数量的列x的。
Details
详情----------Details----------
If y is provided, the function searches for each point in x its nearest neighbor in y. If y is missing, it searches for each point in x its nearest neighbor in x, excluding that point itself. In the case of ties, only the neighbor with the smaller index is given.
如果y,每个x其最近的邻居y点的功能搜索。如果y丢失,搜索每个x其最近的邻居x点,不包括该点本身。在领带的情况下,只用较小的索引的邻居。
The implementation is simple and of complexity nrow(x) times nrow(y). For larger problems, please consider one of the many more efficient nearest neighbor search algorithms.
实施简单和复杂nrow(x)次nrow(y)。对于较大的问题,请考虑许多更有效的近邻搜索算法之一。
值----------Value----------
A data.frame with two columns and nrow(x) rows. The first column is the index of the nearest neighbor, the second column the distance to the nearest neighbor. If y was given, the index is a row number in y, otherwise, in x. The row names of the result are those of x.
一个data.frame两列nrow(x)行。第一列是近邻,近邻的距离,第二列的索引。如果y,该指数是在y行数,否则,在x。结果行名称是那些x。
作者(S)----------Author(s)----------
Oleg Sklyar <a href="mailtosklyar@ebi.ac.uk">osklyar@ebi.ac.uk</a>
举例----------Examples----------
a <- matrix(c(2,2,3,5,1,8,-1,4,5,6), ncol=2L, nrow=5L)
rownames(a) = LETTERS[seq_len(nrow(a))]
matchpt(a)
b <- c(1,2,4,5,6)
d <- c(5.3, 3.2, 8.9, 1.3, 5.6, -6, 4.45, 3.32)
matchpt(b, d)
matchpt(d, b)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|