create: Create networks that conform to particular structures
Description
These functions create a host of different network objects.
Despite the common syntax, what distinguishes them from
those in other packages is that passing the n argument
a vector of two integers will return a two-mode
network instead of a one-mode network.
Usage
create_empty(n)
create_complete(n)
create_ring(n, width = 1, directed = FALSE, ...)
create_components(n, components = 2)
Arguments
n
Number of nodes.
If a single integer is given, the function will create a one-mode network.
If a vector of two integers is given, e.g. n = c(5,10),
the function will create a two-mode network.
width
The width or breadth of the ring. This is typically double the degree.
directed
Whether the graph should be directed. By default FALSE.
...
Additional arguments passed on to igraph.
components
Number of components to create.
Value
By default an igraph object will be returned,
but this can be coerced into other types of objects
using as_matrix() or as_tidygraph().
Details
create_empty() creates an empty graph of the given dimensions.
create_complete() creates a filled graph of the given dimensions.
create_ring() creates a ring or chord graph of the given dimensions
that loops around is of a certain width or thickness.
create_components() creates a graph in which the nodes are clustered
into separate components.