| caugi_layout_bipartite | R Documentation |
Computes node coordinates for bipartite graphs, placing nodes in two parallel lines (rows or columns) based on a partition. If the graph has not been built yet, it will be built automatically before computing the layout.
caugi_layout_bipartite(x, partition = NULL, orientation = c("columns", "rows"))
x |
A |
partition |
Optional logical vector indicating node partitions.
Nodes with |
orientation |
Character string specifying the layout orientation:
|
A data.frame with columns name, x, and y containing node
names and their coordinates.
Other plotting:
add-caugi_plot-caugi_plot,
caugi_layout(),
caugi_layout_circle(),
caugi_layout_fruchterman_reingold(),
caugi_layout_kamada_kawai(),
caugi_layout_sugiyama(),
caugi_layout_tiered(),
caugi_plot(),
divide-caugi_plot-caugi_plot,
plot.caugi()
# Create a bipartite graph (causes -> effects)
cg <- caugi(A %-->% X, A %-->% Y, B %-->% X, B %-->% Y)
partition <- c(TRUE, TRUE, FALSE, FALSE) # A, B = causes, X, Y = effects
# Two horizontal rows (causes on top)
layout_rows <- caugi_layout_bipartite(cg, partition, orientation = "rows")
# Two vertical columns (causes on right)
layout_cols <- caugi_layout_bipartite(cg, partition, orientation = "columns")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.