Chooses MiRA's network layout, the one setting that places the nodes.
Add it to a plot made with mira(); without it, MiRA uses its default
(the bipartite layout for a bipartite network, Fruchterman-Reingold
otherwise).
Arguments
- type
One of
"fruchterman","kamada_kawai","bipartite","circle","grid","random"."bipartite"needsmira(..., bipartite = TRUE).- seed
A whole number. The same seed and the same data give the same node positions, so a figure can be reproduced. Without a seed, a layout that starts from random positions (
"fruchterman", MiRA's default for a network that is not bipartite, among them) differs each time the plot opens.- nested
TRUEorFALSE. Bipartite layout only: sort nodes by degree (nested order).
See also
mira() to start a plot; mira_node(), mira_intralayer(),
mira_interlayer() and mira_layer() for the elements it draws.
Other components:
mira_camera(),
mira_filter(),
mira_interlayer(),
mira_intralayer(),
mira_layer(),
mira_legends(),
mira_mode,
mira_mode_dashboard(),
mira_mode_data(),
mira_mode_grid(),
mira_mode_layer(),
mira_mode_map(),
mira_mode_meta(),
mira_node()
Examples
library(emln)
net <- load_emln(17) # 4 layers; bird and plant nodes
#> Creating state node map
#> Creating extended link list with node IDs
p <- mira(net, bipartite = TRUE, setA_type = "bird")
#> Bipartite network: drawn as undirected. Use directed = TRUE for a directed one.
p + mira_layout("kamada_kawai")
#> Not opened: R is not interactive. Print the plot in an R session, or give `browser` to open it from a script.
# The same node positions every time
p + mira_layout("fruchterman", seed = 42)
#> Not opened: R is not interactive. Print the plot in an R session, or give `browser` to open it from a script.
# Bipartite layout, nodes sorted by degree
p + mira_layout("bipartite", nested = TRUE)
#> Not opened: R is not interactive. Print the plot in an R session, or give `browser` to open it from a script.
