Build metanetwork object

build_metanet(
  metaweb,
  abTable = NULL,
  trophicTable = NULL,
  compute_local_nets = TRUE
)

Arguments

metaweb

metaweb of the metanetwork, object of class 'graph', 'matrix', 'data.frame' or 'dgCMatrix'. Metaweb needs to be directed and connected. This argument must be non-null.

abTable

node abundances in local networks, matrix of class 'matrix', columns must have names corresponding to node labels of the metaweb, rows are node abundances in local networks. Default is null, in that case, uniform abundances are assigned

trophicTable

a 'matrix' or 'data.frame' indicating hierarchy of the nodes. Names of the columns correspond to the different resolutions. It indicates the membership of each node of the metaweb. Default is null.

compute_local_nets

a boolean, indicates whether local networks must be computed or not. Default is TRUE

Value

an object of S3 class 'metanetwork'

Examples

library(metanetwork)
library(igraph)
#with a single metaweb
g = igraph::make_ring(5,directed = TRUE)
meta = build_metanet(g)
#> Warning: nodes of metaweb do not have names. Assigning integers as names

#on Angola dataset (re-building the dataset)
data("meta_angola")
metaweb = meta_angola$metaweb
abTable = meta_angola$abTable
trophicTable = meta_angola$trophicTable 
meta_angola = build_metanet(metaweb,abTable,trophicTable)
print(meta_angola)
#> object of class metanetwork
#> metaweb has 28 nodes and 127 edges 
#> 2 local networks 
#> available resolutions (not computed) are: Species Phylum