readMultiplex: Read ecological multiplex networks using different files for...

View source: R/readNetwork.r

readMultiplexR Documentation

Read ecological multiplex networks using different files for each layer as a 'node-aligned' multilayer network

Description

This functions uses readNetwork() to read files that represent network layers that can be different interaction types, represented by the type attribute of the igraph object.

Usage

readMultiplex(
  fileName,
  types = c("Negative", "Positive", "Antagonistic"),
  filePath = NULL,
  fhead = TRUE,
  skipColumn = 1,
  format = "layers"
)

Arguments

fileName

vector of fileNames with the layers of the networks

types

vector of types that represent the layers

filePath

path of the files NULL by default

fhead

TRUE if the files have header fields, FALSE otherwise.

format

string, "layers" is the default were diferent layers are coded as different files there must be the same number of files as the length of the types vector as each type represent a layer. "GLV" Represent multiple intarction types as pairs of entries in a matrix so competition is represented as ai,j= -1, aj,i=-1, predation ai,j=1,aj,i=-1 where species j is the predator. Mutualism is ai,j=aj,i=1. Any negative or positive number works because intensity of interactions are not registered.

skipColum

integer, number of columns that are skiped 1 by default

Value

an mgraph object that is a list of igraph objects with the type attribute set to each kind of layer or interaction

See Also

readNetwork()

Examples


# Read a vector of files
#
## Not run: 

fpath <- system.file("extdata", package = "multiweb")
dn <- list.files(fpath,pattern = "^Kefi2015.*\\.txt$")
netData <- readMultiplex(dn,c("Negative","Positive","Antagonistic"),fpath,skipColum=2)

## End(Not run)

lsaravia/EcoNetwork documentation built on Nov. 12, 2023, 5:34 p.m.