addEdge(graph)
addEdge()所属R语言包:graph
addEdge
addEdge
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A function to add an edge to a graph.
函数添加一个图形的边缘。
用法----------Usage----------
addEdge(from, to, graph, weights)
参数----------Arguments----------
参数:from
The node the edge starts at
边缘开始的节点
参数:to
The node the edge goes to.
节点的边缘去。
参数:graph
The graph that the edge is being added to.
边缘被添加到图。
参数:weights
A vector of weights, one for each edge.
一个权重向量,每边一个。
Details
详情----------Details----------
Both from and to can be vectors. They need not be the same length (if not the standard rules for replicating the shorter one are used). Edges are added to the graph between the supplied nodes.
既from和to可以是向量。他们需要的是不一样的长度(如果不复制较短的标准规则)。添加到图表提供的节点之间的边缘。
The weights are given for each edge.
weights每边。
The implementation is a bit too oriented towards the graphNEL class and will likely change in the next release to accomodate more general graph classes.
执行是有点太对面向graphNEL类,并可能会在下一个版本中改变,以适应更一般的图类。
If the graph is undirected then the edge is bidirectional (and only needs to be added once). For directed graphs the edge is directional.
如果是无向图的边缘,然后是双向的(只需要添加一次)。为有向图的边是有方向性的。
值----------Value----------
A new instance of a graph object with the same class as graph but with the indicated edges added.
graph但与指定边缘的同一类的图形对象的一个新实例。
作者(S)----------Author(s)----------
R. Gentleman
参见----------See Also----------
addNode,removeEdge,
addNode,removeEdge
举例----------Examples----------
V <- LETTERS[1:4]
edL2 <- vector("list", length=4)
names(edL2) <- V
for(i in 1:4)
edL2[[i]] <- list(edges=c(2,1,2,1)[i], weights=sqrt(i))
gR2 <- new("graphNEL", nodes=V, edgeL=edL2, edgemode="directed")
gX <- addEdge("A", "C", gR2, 1)
gR3 <- randomEGraph(letters[10:14], .4)
gY <- addEdge("n", "l", gR3, 1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|