plot_multilayer_alluvial: Alluvial plot for multilayer network

View source: R/plot_multilayer_alluvial.R

plot_multilayer_alluvialR Documentation

Alluvial plot for multilayer network

Description

Alluvial plot for multilayer network

Usage

plot_multilayer_alluvial(x, module_labels = F)

Arguments

x

An object of class infomap_multilayer.

module_labels

Should module labels be presented

Details

Use ggplot and ggalluvial to plot an alluvial plot that shows the flow of nodes between modules. Very useful for temporal networks. Because the output is a ggplot object it can be further manipulated with standard ggplot2.

Value

An object of class ggplot.

See Also

ggplot2, ggalluvial, infomap_monolayer

Examples

## Not run: 
emln <- create_multilayer_object(extended = siberia1982_7_links,
 nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE)
 
emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, 
flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294,
 temporal_network = TRUE)

# Plot alluvial diagram
plot_multilayer_alluvial(emln_modules, module_labels = FALSE)

# Can also modify the plot
plot_multilayer_alluvial(emln_modules, module_labels = FALSE)+
   geom_stratum(linetype='dashed', color='gray')+
   scale_x_continuous(breaks=seq(0,6,1))+
   scale_y_continuous(breaks=seq(0,70,5))+
   labs(y='Number of species')+
   theme_bw()+
   theme(legend.position = "none",
         panel.grid = element_blank(),
         axis.text = element_text(color='black', size = 20),
         axis.title = element_text(size=20))

## End(Not run)


Ecological-Complexity-Lab/infomap_ecology_package documentation built on June 6, 2024, 5:28 a.m.