Learn R Programming

metanetwork (version 0.7.0)

build_metanet: Build metanetwork object

Description

Build metanetwork object

Usage

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

Value

an object of S3 class 'metanetwork'

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

Examples

Run this code
library(metanetwork)
library(igraph)
#with a single metaweb
g = igraph::make_ring(5,directed = TRUE)
meta = build_metanet(g)

#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)

Run the code above in your browser using DataLab