Learn R Programming

loop (version 1.1)

lclw: find the largest weight food chain among the candidate longest food chains for a given node (species)

Description

Sometimes for a given species, it has many food chains that are equal in chain lengths and all are longest. This function thus will find out the one with largest weight.

Usage

lclw(gemat, sp)

Arguments

gemat
standard square graph matrix
sp
the node/species you want to search

Value

return the pathways and corresponding weights in a list

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

shortest.chain, largest.weight, smallest.weight, longest.chain

Examples

Run this code
#mat=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)
#search for species 3
#lclw(gemat=mat,sp=3)
#longest chain isn't necessary to have largest weights
#largest.weight(gemat=mat,sp=3)
#longest.chain(gemat=mat,sp=3)

Run the code above in your browser using DataLab