Description Usage Arguments Examples
To an existing graph object, add a graph built according to the BarabasiAlbert model, which uses preferential attachment in its stochastic algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 
graph 
A graph object of class 
n 
The number of nodes comprising the preferential attachment graph. 
m 
The number of edges to add in each time step. 
power 
The power of the preferential attachment. The default value of

out_dist 
A numeric vector that provides the distribution of the number of edges to add in each time step. 
use_total_degree 
A logical value (default is 
zero_appeal 
A measure of the attractiveness of the nodes with no adjacent edges. 
algo 
The algorithm to use to generate the graph. The available options
are 
type 
An optional string that describes the entity type for all the nodes to be added. 
label 
A logical value where setting to 
rel 
An optional string for providing a relationship label to all edges to be added. 
node_aes 
An optional list of named vectors comprising node aesthetic
attributes. The helper function 
edge_aes 
An optional list of named vectors comprising edge aesthetic
attributes. The helper function 
node_data 
An optional list of named vectors comprising node data
attributes. The helper function 
edge_data 
An optional list of named vectors comprising edge data
attributes. The helper function 
set_seed 
Supplying a value sets a random seed of the

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  # Create an undirected PA
# graph with 100 nodes, adding
# 2 edges at every time step
pa_graph <
create_graph(
directed = FALSE) %>%
add_pa_graph(
n = 100,
m = 1)
# Get a count of nodes
pa_graph %>% count_nodes()
# Get a count of edges
pa_graph %>% count_edges()

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.