a unified function to format network
or igraph
object.
format_fortify(
model,
nodes = NULL,
weights = NULL,
arrow.gap = ifelse(network::is.directed(model), 0.025, 0),
by = NULL,
scale = TRUE,
stringsAsFactors = getOption("stringsAsFactors", FALSE),
.list_vertex_attributes_fun = NULL,
.get_vertex_attributes_fun = NULL,
.list_edges_attributes_fun = NULL,
.get_edges_attributes_fun = NULL,
.as_edges_list_fun = NULL
)
a data.frame
object.
an object of class network
or igraph
.
a nodes object from a call to fortify.
the name of an edge attribute to use as edge weights when
computing the network layout, if the layout supports such weights (see
'Details').
Defaults to NULL
(no edge weights).
a parameter that will shorten the network edges in order to
avoid overplotting edge arrows and nodes; defaults to 0
when the
network is undirected (no edge shortening), or to 0.025
when the
network is directed. Small values near 0.025
will generally achieve
good results when the size of the nodes is reasonably small.
a character vector that matches an edge attribute, which will be
used to generate a data frame that can be plotted with
facet_wrap
or facet_grid
. The
nodes of the network will appear in all facets, at the same coordinates.
Defaults to NULL
(no faceting).
whether to (re)scale the layout coordinates. Defaults to
TRUE
, but should be set to FALSE
if layout
contains
meaningful spatial coordinates, such as latitude and longitude.
whether vertex and edge attributes should be
converted to factors if they are of class character
. Defaults to
the value of getOption("stringsAsFactors")
, which is FALSE
by default: see data.frame
.
a "list vertex attributes" function.
a "get vertex attributes" function.
a "get edges attributes" function.
a "get edges attributes" function.
a "as edges list" function.