subset.nb(spdep)
subset.nb()所属R语言包:spdep
Subset a neighbours list
集A的邻居列表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function subsets a neighbors list, retaining objects for which the subset argument vector is TRUE.
该功能的子集邻居“列表中,保留对象的子集参数向量为TRUE。
用法----------Usage----------
## S3 method for class 'nb'
subset(x, subset, ...)
参数----------Arguments----------
参数:x
an object of class nb
一个对象的类nb
参数:subset
logical expression
逻辑表达式
参数:...
generic function pass-through
通用直通功能
值----------Value----------
The function returns an object of class nb with a list of integer vectors containing neighbour region number ids (compacted to run from 1:number of regions in subset).
该函数返回一个类的对象nb整数向量含有邻域的入侵检测系统(压缩运行1:一些区域的子集)的列表。
(作者)----------Author(s)----------
Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>
参见----------See Also----------
nb2listw
nb2listw
实例----------Examples----------
example(columbus)
coords <- coordinates(columbus)
plot(col.gal.nb, coords)
to.be.dropped <- c(31, 34, 36, 39, 42, 46)
text(coords[to.be.dropped,1], coords[to.be.dropped,2], labels=to.be.dropped,
pos=2, offset=0.3)
sub.col.gal.nb <- subset(col.gal.nb,
!(1:length(col.gal.nb) %in% to.be.dropped))
plot(sub.col.gal.nb, coords[-to.be.dropped,], col="red", add=TRUE)
which(!(attr(col.gal.nb, "region.id") %in%
attr(sub.col.gal.nb, "region.id")))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|