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

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

[复制链接]
发表于 2012-9-30 14:46:16 | 显示全部楼层 |阅读模式
tri2nb(spdep)
tri2nb()所属R语言包:spdep

                                        Neighbours list from tri object
                                         从三对象的邻居列表

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

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

The function uses the deldir package to convert a matrix of two-dimensional coordinates into a neighbours list of class nb with a list of integer vectors containing neighbour region number ids.
该函数使用deldir包的矩阵二维坐标转换成一个邻居列表类nb的列表包含邻域数IDS的整数向量。


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


tri2nb(coords, row.names = NULL)



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

参数:coords
matrix of point coordinates with two columns
有两列矩阵的点坐标


参数:row.names
character vector of region ids to be added to the neighbours list as attribute region.id, default seq(1, nrow(x))
字符区域的id被添加到向量的邻居列表的属性region.id,默认seq(1, nrow(x))


Details

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

If coordinates are duplicated, this function cannot be used. If the coordinates are from a grid, then they need to be ordered such that the first three are not collinear, so that the first triangle can be constructed. This can be achieved by randomising the order of the coordinates (possibly several times), and then re-ordering the order of the data to match the new order of the neighbour list - if this fix is used, remember to re-order the row.names argument as well as the coordinates! Please also note that triangulation of grid points will give arbitrary diagonal neighbours, which may not be a sensible outcome, and dnearneigh() may serve better where tri2nb() cannot be used.
如果是重复的坐标,此功能不能使用。如果坐标是从一个网格,然后它们需要被这样排列的前三个是不共线,从而使第一个三角形可以构造。这可以通过随机的顺序的坐标(可能是数),然后重新排序的顺序数据以匹配新秩序的邻居列表 - 如果此修复程序时,记得要重新排序的行名称参数以及坐标!还请注意,三角格点给任意对角线邻居,这可能不是一个明智的结果,并dnearneigh()可以更好地服务tri2nb()不能使用。


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

The function returns an object of class nb with a list of integer vectors containing neighbour region number ids.
该函数返回一个类的对象nb的列表包含邻域数IDS的整数向量。


(作者)----------Author(s)----------


Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>



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

knn2nb, dnearneigh, cell2nb
knn2nb,dnearneigh,cell2nb


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


example(columbus)
coords <- coordinates(columbus)
ind <- sapply(slot(columbus, "polygons"), function(x) slot(x, "ID"))
col.tri.nb <- tri2nb(coords, row.names=ind)
plot(columbus, border="grey")
plot(col.tri.nb, coords, add=TRUE)
title(main="Raw triangulation links")
x <- seq(0,1,0.1)
y <- seq(0,2,0.2)
xy <- expand.grid(x, y)
try(xy.nb <- tri2nb(xy))
seed <- 1234
xid <- sample(1:nrow(xy))
xy.nb <- tri2nb(xy[xid,])
plot(xy.nb, xy[xid,])

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-18 03:41 , Processed in 0.029258 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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