this is just a random generation method, the module number of result is not exactly the module_number, you can change the inter_module_density and intra_module_density to get the proper result.

module_net(
  module_number = 3,
  n_node_in_module = 30,
  intra_module_density = 0.3,
  inter_module_density = 0.01
)

Arguments

module_number

number of modules

n_node_in_module

number of nodes in each modules

intra_module_density

intra_module_density, recommend bigger than 20*inter_module_density, default:0.3

inter_module_density

inter_module_density, default:0.01

Value

n-modules metanet

Examples

g1 <- module_net()
get_n(g1)
#>              communities        modularity relative_modularity n_type n_modules
#> 1 3-elements communities 0.604477238341047    1.37887328568458 module         3
plot(g1, mark_module = TRUE)

plot(g1, coors = g_layout(g1, zoom2 = 20))

plot(g1, coors = g_layout_polyarc(g1, group = "module"))

plot(g1, coors = g_layout_polygon(g1, group = "module"))