readNetwork: Read ecological networks in CSV or tab separated file format...

Description Usage Arguments Value Examples

View source: R/readNetwork.r

Description

If the network is in edge list format and there is a third column is treated as an edge attribute with the name of the column

Usage

1
2
readNetwork(fileName, filePath = NULL, fhead = TRUE, skipColumn = 1,
  edgeListFormat = 1)

Arguments

fileName

vector of fileNames with the networks

filePath

path of the files NULL by default

fhead

TRUE if the files have header fields, FALSE otherwise.

edgeListFormat

integer, for the edge list format, if 1 the first column is the "in" (the predator), if 2 the first column is the "out" link (the prey).

skipColum

integer, number of columns that are skiped 1 by default

Value

an igraph object if there is only one file or a list of igraph objects named after the list without extension

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Reads a network in edge list (interaction list) format, with predators as the first column by default
#
fileName <- system.file("extdata", "WeddellSea_FW.csv", package = "multiweb")
g <- readNetwork(fileName)

# Reads a network in adyacency matrix format, with predators as columns
#
fileName <- system.file("extdata", "BarentsBoreal_FW.csv", package = "multiweb")
g <- readNetwork(fileName)

# Read a vector of files
#
## Not run: 
dn <- list.files("inst/extdata",pattern = "^.*\\.csv$")
netData <- readNetwork(dn,"inst/extdata")

## End(Not run)

lsaravia/EcoNetwork documentation built on Oct. 26, 2020, 11:09 p.m.