这是一个创建图的通用函数。
详细信息
make_()
是一个创建图的通用函数。对于 igraph 中每个带有 make_
前缀的图构造器,都有一个不带此前缀的对应函数:例如,对于 make_ring()
,也有 ring()
等。
对于随机图采样器来说,情况也是如此,即对于每个带有 sample_
前缀的构造器,都有一个不带此前缀的对应函数。
这些较短的形式可以与 make_()
一起使用。这种形式的优点是用户可以指定构造器修饰符,这些修饰符适用于所有构造器。例如,with_vertex_()
修饰符将顶点属性添加到新创建的图中。
请参阅以下示例和各种构造器修饰符。
参见
其他确定性构造器:graph_from_atlas()
, graph_from_edgelist()
, graph_from_literal()
, make_chordal_ring()
, make_empty_graph()
, make_full_citation_graph()
, make_full_graph()
, make_graph()
, make_lattice()
, make_ring()
, make_star()
, make_tree()
构造器修饰符(及相关函数)sample_()
, simplified()
, with_edge_()
, with_graph_()
, with_vertex_()
, without_attr()
, without_loops()
, without_multiples()
示例
r <- make_(ring(10))
l <- make_(lattice(c(3, 3, 3)))
r2 <- make_(ring(10), with_vertex_(color = "red", name = LETTERS[1:10]))
l2 <- make_(lattice(c(3, 3, 3)), with_edge_(weight = 2))
ran <- sample_(degseq(c(3, 3, 3, 3, 3, 3), method = "configuration"), simplified())
degree(ran)
#> [1] 3 3 3 3 3 3
is_simple(ran)
#> [1] TRUE