addNode(graph)
addNode()所属R语言包:graph
addNode
addnode的
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Add one or more nodes to a graph.
将一个或多个节点添加一个图形。
用法----------Usage----------
addNode(node, object, edges)
参数----------Arguments----------
参数:node
A character vector of node names.
特征向量的节点名称。
参数:object
A graph
一个graph
参数:edges
A named list of edges.
边一个命名列表。
Details
详情----------Details----------
The supplied nodes are added to the set of nodes of the object.
所提供的nodeS被添加到一套object节点。
If edges are provided then their must be the same number as there are nodes and the must be in the same order. The elements of the edges list are vectors. They can be character vectors of node labels for nodes in object and if so then they are added with unit weights. If the vector is numeric then it must be named (with labels corresponding to nodes in the object) and the values are taken to be the edge weights.
如果edges提供,那么他们必须是相同的号码,作为有node的,必须以相同的顺序。 edges列表中的元素是向量。他们可以在节点节点标签的特征向量object如果是的话,他们正在与单位重量的增加。如果向量是数字,那么它必须被命名为(对应object节点与标签)和采取的是边权重值。
When the object is a distGraph then the edges must be supplied and they must contain appropriate distances for all nodes both those in object and those supplied.
当object是distGraph然后edges必须提供它们必须包含的所有节点都在object那些提供适当的距离。
值----------Value----------
A new graph of the same class as object with the supplied node added to the set of nodes.
同一类的一个新图object提供的节点添加到的节点集。
作者(S)----------Author(s)----------
R. Gentleman
参见----------See Also----------
removeNode, removeEdge,
removeNode,removeEdge
举例----------Examples----------
V <- LETTERS[1:4]
edL1 <- vector("list", length=4)
names(edL1) <- V
for(i in 1:4)
edL1[[i]] <- list(edges=c(2,1,4,3)[i], weights=sqrt(i))
gR <- new("graphNEL", nodes=V, edgeL=edL1)
gX <- addNode("X", gR)
set.seed(123)
g1 <- randomGraph(letters[1:10], 1:4, p=.3)
g2 <- addNode("z", g1, edges=list(c("a", "h", "g")))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|