coincident(SpatialTools)
coincident()所属R语言包:SpatialTools
Determine coincident locations
确定重合的位置
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Determines the coincident locations for two sets of coordinates.
确定两个坐标集的重合位置。
用法----------Usage----------
coincident(coords1, coords2)
参数----------Arguments----------
参数:coords1
A numeric matrix of size n1 \times 2 containing a set of coordinates.
一个数字矩阵的大小n1 \times 2含有一组坐标。
参数:coords2
A numeric matrix of size n2 \times 2 containing a set of coordinates.
一个数字矩阵的大小n2 \times 2含有一组坐标。
Details
详细信息----------Details----------
This function calls a C++ algorithm using the Rcpp package. This (may) result in a significant speedup over pure R code since the search algorithm involves loops. An implicit assumptions is that there are no duplicate coordinates in coords1 and coords2, respectively. In other words, each row of coords1 is unique and each row of coords2 is unique. There is at most 1 row of coords1 that will match with a row in coords2.
这个函数调用C + +算法使用RCPP包。 (5月)的结果在显着加速比纯R代码,因为搜索算法包括循环。一个隐含的假设是coords1和coords2,有没有重复的坐标。换言之,每一行coords1是唯一的,并且每行coords2是独特的。有1排coords1将匹配在coords2有一排在最。
值----------Value----------
Returns a matrix with the indices of the coincident locations. Specifically, an r \times 2 matrix will be returned, with r being the number of coordinates in coords1 coinciding with coordinates in coords2. If row i of the matrix was (2, 5), then the ith set of coincident locations was between the 2nd row of coords1 and the 5th row of coords2. If there are no coincident locations, then a matrix of size 0 \times 2 will be returned.
返回一个矩阵与重合位置的索引。具体而言,r \times 2矩阵将被退回,r对数坐标coords1一致的坐标在coords2。如果i行的矩阵的时间是(2,5),然后重合的位置的第i组的coords1之间的第2行和第5行的coords2。如果没有一致的位置,然后以矩阵的大小0 \times 2将被返回。
(作者)----------Author(s)----------
Joshua French
参见----------See Also----------
cov.st
cov.st
实例----------Examples----------
#Generate two sets of coordinates[生成两个坐标集]
loc1 <- as.matrix(expand.grid(seq(0, 1, len = 25), seq(0, 1, len = 25)))
loc2 <- as.matrix(expand.grid(seq(0, 1, len = 101), seq(0, 1, len = 101)))
#Return indices of coincident coordinates[回报指数一致的坐标]
coincident(loc1, loc2)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|