aggregate.nb(spdep)
aggregate.nb()所属R语言包:spdep
Aggregate a spatial neighbours object
总空间的邻居对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The method aggregates a spatial neighbours object, creating a new object listing the neighbours of the aggregates.
方法聚集空间的邻居对象,创建一个新的对象,列出了邻居们的聚集。
用法----------Usage----------
## S3 method for class 'nb'
aggregate(x, IDs, remove.self = TRUE, ...)
参数----------Arguments----------
参数:x
an nb neighbour object
的NB邻居对象
参数:IDs
a character vector of IDs grouping the members of the neighbour object
字符向量分组成员的邻居对象的ID
参数:remove.self
default TRUE: remove self-neighbours resulting from aggregation
默认情况下TRUE:删除自邻居的聚集
参数:...
unused - arguments passed through
未使用 - 通过参数
值----------Value----------
an nb neighbour object
的NB邻居对象
注意----------Note----------
Method suggested by Roberto Patuelli
建议的方法罗伯托Patuelli
(作者)----------Author(s)----------
Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>
实例----------Examples----------
data(used.cars)
data(state)
cont_st <- match(attr(usa48.nb, "region.id"), state.abb)
cents <- as.matrix(as.data.frame(state.center))[cont_st,]
opar <- par(mfrow=c(2,1))
plot(usa48.nb, cents, xlim=c(-125, -65), ylim=c(25, 50))
IDs <- as.character(state.division[cont_st])
agg_cents <- aggregate(cents, list(IDs), mean)
agg_nb <- aggregate(usa48.nb, IDs)
plot(agg_nb, agg_cents[, 2:3], xlim=c(-125, -65), ylim=c(25, 50))
text(agg_cents[, 2:3], agg_cents[, 1], cex=0.6)
par(opar)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|