ggplotin ggplot2. It takes care of setting up the plot object along with creating the layout for the plot based on the graph and the specification passed in. Alternatively a layout can be prepared in advance using
create_layoutand passed as the data argument. See Details for a desciption of all available layouts.
ggraph(graph, layout = "auto", ...)create_layout(graph, layout, circular, ...)"create_layout"(graph, layout, ...)"create_layout"(graph, layout, circular = FALSE, ...)"create_layout"(graph, layout, circular = FALSE, ...)"create_layout"(graph, layout, circular = FALSE, ...)"create_layout"(graph, layout, circular = FALSE, ...)
layout_ggraphobject as returned from
create_layoutin which case all subsequent arguments is ignored.
ggraph()an object of class gg onto which layers, scales, etc. can be added. For
create_layout()an object inherting from
layout_ggraphitself inherits from
data.frameand can be considered as such. The data.frame contains the node positions in the
ycolumn along with additional columns generated by the specific layout, as well as node parameters inherited from the graph. Additional information is stored as attributes to the data.frame. The original graph object is stored in the
graphattribute and the
circularattribute contains a logical indicating whether the layout has been transformed to a circular representation.
dendrogram class is used to store binary tree from
e.g. hierarchical clustering. The layouts provided for this class is
constrained to tree-like representations.
are supported through automatic conversion to dendrogram objects and thus
supports the same layouts.
Further, if the layouts provided for igraph objects are needed for dendrogram
den_to_igraph is provided to convert dendrograms to
Any type of regular graph/network data can be represented as an igraph
object. Because of this the different layouts that can be applied to igraph
objects are quite diverse, but not all layouts makes sense to all types of
graphs. It is up to the user to understand their data and choose an
appropriate layout. For standard node-edge diagrams igraph itself defines a
long range of different layout functions that are all available through the
igraph layout where the specific layout is specified using the
algorithm argument. In order to minimize typing all igraph algorithms
can also be passed directly into the
network objects are supported by automatic conversion
to igraph objects using
network_to_igraph and thus supports the
get_edgesfor extracting edge information from the layout and
get_confor extracting path information.
require(igraph) gr <- make_graph('bull') layout <- create_layout(gr, layout = 'igraph', algorithm = 'kk')