is.symmetric.nb(spdep)
is.symmetric.nb()所属R语言包:spdep
Test a neighbours list for symmetry
测试对称邻居列表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Checks a neighbours list for symmetry/transitivity (if i is a neighbour of j, then j is a neighbour of i). This holds for distance and contiguity based neighbours, but not for k-nearest neighbours. The helper function sym.attr.nb() calls is.symmetric.nb() to set the sym attribute if needed, and make.sym.nb makes a non-symmetric list symmetric by adding neighbors. is.symmetric.glist checks a list of general weights corresponding to neighbours for symmetry for symmetric neighbours.
检查一个邻居列表的对称/及物(如果我是邻居的j,j是我的邻居)。这对距离和连续性邻居,但不是k-最近的邻居。辅助函数sym.attr.nb()调用is.symmetric.nb()的sym属性如果需要的话,和make.sym.nb使得非对称列表对称的,通过添加邻居。 is.symmetric.glist检查的一般权重相应对称的对称邻居的邻居的列表。
用法----------Usage----------
is.symmetric.nb(nb, verbose = NULL, force = FALSE)
sym.attr.nb(nb)
make.sym.nb(nb)
old.make.sym.nb(nb)
is.symmetric.glist(nb, glist)
参数----------Arguments----------
参数:nb
an object of class nb with a list of integer vectors containing neighbour region number ids.
类的一个对象nb的列表包含邻域数IDS的整数向量。
参数:verbose
default NULL, use global option value; if TRUE prints non-matching pairs
默认为空,请使用全局选项的值;如果TRUE打印,不匹配的对
参数:force
do not respect a neighbours list sym attribute and test anyway
不尊重sym属性,测试反正一个邻居列表
参数:glist
list of general weights corresponding to neighbours
一般的权重对应的邻居列表
值----------Value----------
TRUE if symmetric, FALSE if not; is.symmetric.glist returns a value with an attribute, "d", indicating for failed symmetry the largest failing value.
TRUE,如果对称,否则为false; is.symmetric.glist属性返回一个值,“D”,表示失败的对称性最大的失败的值。
注意----------Note----------
A new version of make.sym.nb by Bjarke Christensen is now included. The older version has been renamed old.make.sym.nb, and their comparison constitutes a nice demonstration of vectorising speedup using sapply and lapply rather than loops. When any no-neighbour observations are present, old.make.sym.nb is used.
一个新版本的make.sym.nb由Bjarke克里斯滕森是现在。较旧的版本已经更名为old.make.sym.nb,和他们的对比构成了一个很好的示范,的使用sapply和lapply,而不是循环的向量化加速。当任何没有邻居的意见,old.make.sym.nb使用。
(作者)----------Author(s)----------
Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>
参见----------See Also----------
read.gal
read.gal
实例----------Examples----------
example(columbus)
coords <- coordinates(columbus)
ind <- sapply(slot(columbus, "polygons"), function(x) slot(x, "ID"))
print(is.symmetric.nb(col.gal.nb, verbose=TRUE, force=TRUE))
k4 <- knn2nb(knearneigh(coords, k=4), row.names=ind)
k4 <- sym.attr.nb(k4)
print(is.symmetric.nb(k4))
k4.sym <- make.sym.nb(k4)
print(is.symmetric.nb(k4.sym))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|