ggraph
but can also be used stand-alone to save and reuse
layouts. createLayout is an S3 generic with methods for the different
supported object.
createLayout(graph, layout, circular, ...)
"createLayout"(graph, layout, ...)
"createLayout"(graph, layout, circular = FALSE, ...)
"createLayout"(graph, layout, circular = FALSE, ...)
"createLayout"(graph, layout, circular = FALSE, ...)
"createLayout"(graph, layout, circular = FALSE, ...)
layout_ggraph
. layout_ggraph
itself inherits from data.frame
and can be considered as such. The
data.frame contains the node positions in the x
and y
column
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
graph
attribute and the circular
attribute contains a logical
indicating whether the layout has been transformed to a circular
representation.
The 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 and include:
igraph objects
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. Furthermore ggraph itself defines additional layouts:
gEdges
for extracting edge information from the
layout and gCon
for extracting path information.
require(igraph)
gr <- make_graph('bull')
layout <- createLayout(gr, layout = 'igraph', algorithm = 'kk')
Run the code above in your browser using DataLab