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

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

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

                                        Find the minimal spanning tree
                                         最小生成树

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

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

The minimal spanning tree is a connected graph with n nodes and n-1 edges. This is a smaller class of possible partitions of a graph by pruning edges with high dissimilarity. If one edge is removed, the graph is partioned in two unconnected subgraphs. This function implements the algorithm due to Prim (1987).
最小生成树有n个节点和N-1条边的连通图。这是一个较小的类可能的分区图与高差异性的修剪边缘。如果一个边缘被移除时,图partioned在两个未连接的子图。此函数实现的算法,由于(1987)的Prim。


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


mstree(nbw, ini = NULL)



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

参数:nbw
An object of listw class returned by nb2listw function. See this help for details.
一个对象返回listw类的的nb2listw功能。有关详细信息,请参阅此帮助。


参数:ini
The initial node in the minimal spanning tree.
初始节点的最小生成树。


Details

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

The minimum spanning tree algorithm.
最小生成树算法。

Input a connected graph.
输入连接图。

Begin a empty set of nodes.
开始一个空的节点集。

Add an arbitrary note in this set.
加入该集合中的任意一个音符。

While are nodes not in the set, find a minimum cost edge connecting a node in the set and a node out of the set and add this node in the set.
虽然不在集合中的节点,找到一个的最小费用边缘连接一个节点集和一个节点集集合中添加此节点。

The set of edges is a minimum spanning tree.  
的边集是最小生成树。


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

A matrix with n-1 rows and tree columns. Each row is two nodes and the cost, i. e. the edge and it cost.
具有n-1行和树列的矩阵。每行是两个节点和成本,我。 E。的边缘,它的成本。


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


Renato M. Assuncao and Elias T. Krainski



参考文献----------References----------

generalisations. In: Bell System Technical Journal, 36, pp. 1389-1401

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


### loading data[##加载数据]
bh <- readShapePoly(system.file("etc/shapes/bhicv.shp",
      package="spdep")[1])
### data padronized[##数据padronized]
dpad <- data.frame(scale(bh@data[,5:8]))

### neighboorhod list [##neighboorhod列表]
bh.nb <- poly2nb(bh)

### calculing costs[##calculing成本,]
lcosts <- nbcosts(bh.nb, dpad)

### making listw[##制造listw的]
nb.w <- nb2listw(bh.nb, lcosts, style="B")

### find a minimum spanning tree[##找到的最小生成树]
system.time(mst.bh <- mstree(nb.w,5))

dim(mst.bh)

head(mst.bh)
tail(mst.bh)

### the mstree plot[##的mstree的图]
par(mar=c(0,0,0,0))
plot(mst.bh, coordinates(bh), col=2,
     cex.lab=.7, cex.circles=0.035, fg="blue")
plot(bh, border=gray(.5), add=TRUE)


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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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