plot_modular_matrix: Plot a matrix with colored interactions by modules

View source: R/plot_modular_matrix.R

plot_modular_matrixR Documentation

Plot a matrix with colored interactions by modules

Description

Plot a matrix with colored interactions by modules

Usage

plot_modular_matrix(
  x,
  fix_coordinates = T,
  axes_titles = c("Set 1", "Set 2"),
  transpose = F,
  outside_module_col = "gray"
)

Arguments

x

An object of class infomap_monolayer.

fix_coordinates

Should x and y coordinates be fixed by ggplot to create square cells.

axes_titles

Titles for axes

transpose

Option to transpose the matrix. Useful for matrices with very differnt numbers of rows and columns.

outside_module_col

Color of interactions outside modules.

Details

Use ggplot to plot a matrix in which cells (network interactions) are colored. Interactions that fall outside the modules are colored in outside_module_col and those that fall inside the module are colored by colors automatically generated by gg_color_hue from package metafolio.

Value

An object of class ggplot.

See Also

ggplot2, infomap_monolayer

Examples

## Not run: 
network_object <- create_monolayer_network(bipartite::memmott1999,
 bipartite = TRUE, directed = FALSE, group_names = c('A','P'))
 
infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap',
                                       flow_model = 'undirected',
                                       silent=TRUE, trials=20, two_level=TRUE, seed=123)
plot_modular_matrix(infomap_object, fix_coordinates = TRUE)
 
## End(Not run)
 

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