Learn R Programming

loop (version 1.1)

find.ranks: make food trophic ranks for all the species in the matrix for fplot.foodweb function

Description

it will return trophic ranks of species in the food webs

Usage

find.ranks(gemat, converted = TRUE)

Arguments

gemat
gemat is a square matrix
converted
if TRUE, resultant trophic ranks of species will be converted to a list, which is the input format for fplot.foodweb() function; if FALSE, resultant trophic ranks of species are present in a vector default is TRUE

Value

it will return a list (converted=TRUE), each list represent one trophic rank, the elements of which are the species being classified into the rank. it can also return a vector (converted=FALSE), each element denote the rank of the species.

References

Chen Y (2012) loop: an R package for performing decomposition of weighted directed graphs, food web analysis and flexible network plotting. Submitted.

See Also

fplot.foodweb

Examples

Run this code
gemat<-matrix(c(0,5,3,7,0,5,0,8,0,4,3,8,0,1,6,7,0,1,0,2,0,4,6,2,0),5,5)
ranks<-find.ranks(gemat)
fplot.foodweb(gemat=gemat,ranks=ranks,addlabels=TRUE,bg="white",pch=21,pcex=4,lcol=2,weighted=FALSE)

Run the code above in your browser using DataLab