edgeMatrix(graph)
edgeMatrix()所属R语言包:graph
Compute an Edge Matrix or weight vector for a Graph
计算矩阵图的边缘或权重向量
译者:生物统计家园网 机器人LoveR
描述----------Description----------
For our purposes an edge matrix is a matrix with two rows and as many columns as there are edges. The entries in the first row are the index of the node the edge is from, those in the second row indicate the node the edge is to.
边矩阵,为我们的宗旨是用两行和多列,因为那里是边缘的矩阵。在第一行中的条目索引的优势是,从第二行显示的边缘节点的节点。
If the graph is “undirected” then the duplicates option can be used to indicate whether reciprocal edges are wanted. The default is to leave them out. In this case the notions of from and to are not relevant.
如果图是“无向”duplicates选项可以用来表明是否想倒数边缘。默认的是给他们留下了。在这种情况下,从“和”的概念是不相关的。
用法----------Usage----------
edgeMatrix(object, duplicates=FALSE)
eWV(g, eM, sep = ifelse(edgemode(g) == "directed", "->",
"--"), useNNames=FALSE)
pathWeights(g, p, eM=NULL)
参数----------Arguments----------
参数:object
An object that inherits from graph.
从graph继承的对象。
参数:g
An object that inherits from graph.
从graph继承的对象。
参数:duplicates
Whether or not duplicate edges should be produced for “undirected” graphs.
重复边缘是否应“无向图”的制作。
参数:eM
An edge matrix
一个边缘矩阵
参数:sep
a character string to concatenate node labels in the edge label
一个字符串来连接节点的标签边缘标签
参数:useNNames
a logical; if TRUE, node names are used in the edge label; if FALSE, node indices are used
逻辑;如果为TRUE,节点名称在边缘标签;如果为FALSE,节点指数
参数:p
a vector of node names constituting a path in graph g
节点名称的向量构成图g路径
参数:...
arguments passed to edgeMatrix.
参数传递到edgeMatrix。
Details
详情----------Details----------
Implementations for graphNEL, clusterGraph and distGraph are available.
graphNEL,clusterGraph和distGraph实现是可用的。
值----------Value----------
edgeMatrix returns a matrix with two rows, from and to, and as many columns as there are edges. Entries indicate the index in the node vector that corresponds to the appropriate end of the edge.
edgeMatrix两行返回一个矩阵,并,是边缘有许多列。条目显示在节点向量对应的边缘适当的最终指数。
eWV uses the edge matrix to create an annotated vector of edge weights.
eWV使用边矩阵,创建一个边权注明的向量。
pathWeights returns an annotated vector of edge weights for a specified path in a graph.
pathWeights返回指定的路径图中的一个边权注明向量。
注意----------Note----------
A path through an undirected graph may have several representations as a named vector of edges. Thus in the example, when the weights for path b-a-i are requested, the result is the pair of weights for edges a–b and a–i,
通过一个无向图的路径可能有几个交涉命名为向量的边缘。因此在这个例子中,请求路径白族的重量时,其结果是对A-B边的权重和A-I,
作者(S)----------Author(s)----------
R. Gentleman
参见----------See Also----------
edges
edges
举例----------Examples----------
set.seed(123)
g1 <- randomGraph(letters[1:10], 1:4, p=.3)
edgeMatrix(g1)
g2 <- new("clusterGraph", clusters=list(a=c(1,2,3), b=c(4,5,6)))
em2 <- edgeMatrix(g2)
eWV(g1, edgeMatrix(g1))
eWV(g1, edgeMatrix(g1), useNNames=TRUE)
pathWeights(g1, c("b", "a", "i"))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|