Add a preferential attachment graphSource:
To an existing graph object, add a graph built according to the Barabasi-Albert model, which uses preferential attachment in its stochastic algorithm.
m = NULL,
power = 1,
out_dist = NULL,
use_total_degree = FALSE,
zero_appeal = 1,
algo = "psumtree",
type = NULL,
label = TRUE,
rel = NULL,
node_aes = NULL,
edge_aes = NULL,
node_data = NULL,
edge_data = NULL,
set_seed = NULL
A graph object of class
The number of nodes comprising the preferential attachment graph.
The number of edges to add in each time step.
The power of the preferential attachment. The default value of
1indicates a linear preferential attachment.
A numeric vector that provides the distribution of the number of edges to add in each time step.
A logical value (default is
TRUE) that governs whether the total degree should be used for calculating the citation probability. If
FALSE, the indegree is used.
A measure of the attractiveness of the nodes with no adjacent edges.
The algorithm to use to generate the graph. The available options are
bag. With the
psumtreealgorithm, a partial prefix-sum tree is used to to create the graph. Any values for
zero_appealcan be provided and this algorithm never generates multiple edges. The
psumtree-multiplealgorithm also uses a partial prefix-sum tree but the difference here is that multiple edges are allowed. The
bagalgorithm places the node IDs into a bag as many times as their in-degree (plus once more). The required number of cited nodes are drawn from the bag with replacement. Multiple edges may be produced using this method (it is not disallowed).
An optional string that describes the entity type for all the nodes to be added.
A logical value where setting to
TRUEascribes node IDs to the label and
FALSEyields a blank label.
An optional string for providing a relationship label to all edges to be added.
An optional list of named vectors comprising node aesthetic attributes. The helper function
node_aes()is strongly recommended for use here as it contains arguments for each of the accepted node aesthetic attributes (e.g.,
An optional list of named vectors comprising edge aesthetic attributes. The helper function
edge_aes()is strongly recommended for use here as it contains arguments for each of the accepted edge aesthetic attributes (e.g.,
An optional list of named vectors comprising node data attributes. The helper function
node_data()is strongly recommended for use here as it helps bind data specifically to the created nodes.
An optional list of named vectors comprising edge data attributes. The helper function
edge_data()is strongly recommended for use here as it helps bind data specifically to the created edges.
Supplying a value sets a random seed of the