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

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

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

                                        Construct neighbours list from polygon list
                                         构建邻居从多边形的名单列表

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

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

The function builds a neighbours list based on regions with contiguous boundaries, that is sharing one or more boundary point. The current function is in part interpreted and may run slowly for many regions or detailed boundaries, but from 0.2-16 should not fail because of lack of memory when single polygons are built of very many border coordinates.
这个函数建立一个邻居列表的基础上,共享一个或多个边界点与相邻的边界区域。目前的功能是解释的部分,可能会运行缓慢许多区域或详细的界限的,但是从0.2-16不应该失败,因为内存不足时单一的多边形构建的很多边界坐标。


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


poly2nb(pl, row.names = NULL, snap=sqrt(.Machine$double.eps),
queen=TRUE, useC=TRUE, foundInBox=NULL)



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

参数:pl
list of polygons of class extending SpatialPolygons, or an object of a class polylist, which is retained for compatibility reasons
延伸的列表类的多边形SpatialPolygons,或对象的一类polylist,这是保持兼容性的原因,


参数:row.names
character vector of region ids to be added to the neighbours list as attribute region.id, default seq(1, nrow(x)); if polys has a region.id attribute, it is copied to the neighbours list.
区域IDS的字符向量被添加到邻居列表作为属性region.id,默认seq(1, nrow(x))如果polys有region.id属性,它被复制到邻居的列表。


参数:snap
boundary points less than snap distance apart are considered to indicate contiguity
边界点不到snap距离除了被认为是表明连续性


参数:queen
if TRUE, a single shared boundary point meets the contiguity condition, if FALSE, more than one shared point is required; note that more than one shared boundary point does not necessarily mean a shared boundary line
如果为true,一个单一的共享边界点满足连续性条件,如果为FALSE,多个共享点需要注意多个共享的边界点并不一定意味着一个共同的边界线


参数:useC
default TRUE, doing the work loop in C, may be set to false to revert to R code calling two C functions in an n*k work loop, where k is the average number of candidate neighbours
默认为true,循环在C做的工作,可能会被设置为false,以恢复到R代码调用两个C函数在n*k工作循环,k候选邻居的平均数


参数:foundInBox
default NULL using R code, possibly parallelised if a snow cluster is available, otherwise a list of length (n-1) with integer vectors of candidate neighbours (j > i), or NULL if all candidates were (j < i) (as created by the poly_findInBoxGEOS function in rgeos for clean polygons)
默认为空R代码,可能并行化,如果一个snow聚类是可用的,否则一个列表的长度(n-1)整数向量的候选邻居(j > i),或NULL,如果所有候选人都<X >((j < i)函数创建poly_findInBoxGEOS清洁多边形)


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

A neighbours list with class nb. See card for details of &ldquo;nb&rdquo; objects.
一个邻居列表中与类nb。见card的“NB”对象的详细信息。


注意----------Note----------

From 0.5-8, the function includes faster bounding box indexing and other improvements contributed by Micah Altman. If a cluster is provided using set.ClusterOption, it will be used for finding candidate bounding box overlaps for exact testing for contiguity.
从0.5-8,功能包括更快的包围盒索引和其他方面的改进弥迦书奥特曼贡献。如果聚类提供使用set.ClusterOption,它将被用来发现候选邻近的精确测试的包围盒重叠。


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


Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a> with contributions from Micah Altman



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

summary.nb, card
summary.nb,card


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


example(columbus)
coords <- coordinates(columbus)
xx <- poly2nb(columbus)
dxx <- diffnb(xx, col.gal.nb)
plot(columbus, border="grey")
plot(col.gal.nb, coords, add=TRUE)
plot(dxx, coords, add=TRUE, col="red")
title(main=paste("Differences (red) in Columbus GAL weights (black)",
"and polygon generated queen weights", sep="\n"))
xxx <- poly2nb(columbus, queen=FALSE)
dxxx <- diffnb(xxx, col.gal.nb)
plot(columbus, border = "grey")
plot(col.gal.nb, coords, add = TRUE)
plot(dxxx, coords, add = TRUE, col = "red")
title(main=paste("Differences (red) in Columbus GAL weights (black)",
"and polygon generated rook weights", sep="\n"))
cards <- card(xx)
maxconts <- which(cards == max(cards))
if(length(maxconts) > 1) maxconts <- maxconts[1]
fg <- rep("grey", length(cards))
fg[maxconts] <- "red"
fg[xx[[maxconts]]] <- "green"
plot(columbus, col=fg)
title(main="Region with largest number of contiguities")
example(nc.sids)
system.time(xxnb <- poly2nb(nc.sids))
plot(nc.sids)
plot(xxnb, coordinates(nc.sids), add=TRUE, col="blue")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-18 01:51 , Processed in 0.019855 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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