Skip to contents

Create and manipulate graph objects

Create graph objects

create_bipartite()
Create a random bipartite network
create_census_graph()
Create a Dyad Census-Conditioned Random Graph
create_community_graph()
Create a graph with a given community structure
create_components_graph()
Create a graph with strict components
create_empty_graph()
Create an empty network
create_manual_graph()
Create a manual (literal) graph
create_random_graph()
Create a random bipartite network

Remove parts of the graph

Add elements to the graph

add_edge_attributes()
Add edge attributes to a graph
add_graph_attribute()
Add a graph attribute
add_vertex_attributes()
Add vertex attributes to a graph
add_vertex_names()
Add vertex names to a graph

Extract parts of the graph

Functions starting with extract_*. The functions that contain _comm_ extract community structures from the graph.

extract_vertex_attribute() extract_vertex_names() extract_edge_attribute() extract_graph_attribute()
Extract attributes from the graph object
extract_all_vertex_attributes()
Extract all vertex attributes
extract_comm_fastgreedy()
Community structure via greedy optimization of modularity
extract_comm_girvan()
Community structure based on edge betweenness
extract_comm_louvain()
Community structure via multi-level optimization of modularity
extract_comm_walktrap()
Community structure via short random walks
extract_edge_id()
Extract edge id's
extract_egonet()
Extract ego networks
extract_intersection()
Intersection of graphs
extract_isolates()
Extract the isolates
extract_loops() extract_loops_vertex()
Extract loops
extract_neighbors()
Extract the neighbors of a vertex
extract_subgraph()
Extract a subgraph

List parts of the graph

Indicators

Indicators of specific traits of the graph, returning TRUE or FALSE

has_edge_attributes() has_vertex_attributes() has_vertex_attribute() has_edge_attribute() has_vertexnames() has_loops() has_isolates()
Check for the existence of edge attributes in the graph
is_bipartite()
Is the network bipartite?
is_connected()
Is the network connected?
is_directed()
Is the network directed?
is_signed()
Is the network signed?
is_network() is_igraph()
Is something?
is_weighted()
Is the network weighted?

Make new objects from the graph object

Use (info from) the graph object(s) to construct some useful output object

make_edgelist()
Make an edgelist from row data
make_matrix_from_vertex_attribute()
Make a matrix from a vertex attribute
make_mixingmatrix()
Construct a mixing matrix
make_nodelist()
Make a node list from row data
make_perturbed_graph()
Perturb a binary graph
make_union()
Union of graphs

Conversion between graph classes

to_binary_matrix()
Dichotomize a matrix
to_edgelist()
Make edgelist
to_igraph()
Make igraph object
to_matrix()
Make a matrix from a graph
to_network()
Make network object
to_symmetric_matrix()
Symmetrize an adjacency matrix

Some additional graph manipulation

contract_vertices()
Contract multiple vertices into 1 new vertex
merge_membership()
Merge community membership

Display the graph object

print(<igraph>) print(<network>)
Print the graph object

Network measures

Graph-level indices

Indices at the level of the graph itself Functions starting with count_* provide a count of specific greaph-level attributes. Functions starting with g_* calculate common graph-level indices, such as mean distance, centralization, or reciprocity.

g_summary() g_density() g_mean_distance() g_correlation() g_reciprocity() g_transitivity() g_diameter() g_radius() g_compactness() g_degree_distribution()
Graph level indices
count_dyads()
Count dyad types
count_edges()
Number of edges in the graph
count_edges_in_interval()
Count edges in time interval
count_triads()
Count triad types
count_unique_edges_in_interval()
Count unique edges in time interval
count_vertices()
Number of vertices in the graph
g_centralize()
Centralization
g_efficiency()
Compute Graph Efficiency
g_secrecy() v_secrecy()
secrecy index
g_vuln_attack()
Vulnerability: attack
g_vuln_efficiency()
Vulnerability: efficiency
g_vuln_paths()
Vulnerability: paths

Edge-level indices

Indices at the level of the dyads (directed or undirected) (Almost) all functions start with d_*

d_distance()
Dyad level indices
d_structural_equivalence()
Structural equivalence

Vertex-level indices

Indices at the level of the vertices

v_degree() v_eccentricity() v_betweenness() v_stress() v_eigenvector() v_closeness() v_harmonic() v_pagerank() v_geokpath() v_shapley()
Vertex level indices
g_secrecy() v_secrecy()
secrecy index
v_bottleneck()
Find the Bottleneck centrality score
v_distance()
Distances to and from a vertex
v_geokpath_w()
Geodesic k-path centrality

Tools for statistical modeling

fix_cug_input()
Fix intermediate CUG input
stat_ef_int()
Estimate the intensity of effects using odds ratio and probabilities
stat_nam()
Network autocorrelation model
stat_nam_summary()
Network autocorrelation results
stat_plot_gof()
Plot the Goodness of fit of a (bt)ergm result
stat_plot_gof_as_btergm()
gof and plot (btergm style)
plot_nam()
Plot diagnostics for the network autorrelation model

Plotting

Generic functions to plot graph objects. Also, functions to plot features of the graph or output from statistical network models.

plot(<igraph>) plot(<network>)
Plot the graph object
plot_centralities()
Plot one or more centrality scores
plot_comm_dendrogram()
Plot a dendrogram of the community structure
plot_nam()
Plot diagnostics for the network autorrelation model
plot_network_slices()
Plot network slices

Datasets

A small set of datasets, mainly used in examples or testing. A more interesting set of data for the SNA4DS course can be found in the SNA4DSData package.

florentine
Florentine families
judge_net
Judges network
Madrid_bombing
Madrid Train Bombing 2004 (dataset)
soccer98
Soccer98 network