Learn R Programming

cheddar (version 0.1-639)

Node connectivity: Node connectivity

Description

Functions that report the connectivity of nodes in a food web.

Usage

IsBasalNode(community)
IsTopLevelNode(community) 
IsIntermediateNode(community) 
IsIsolatedNode(community) 
IsConnectedNode(community) 
IsNonBasalNode(community) 
IsNonTopLevelNode(community) 

BasalNodes(community) TopLevelNodes(community) IntermediateNodes(community) IsolatedNodes(community) ConnectedNodes(community) NonTopLevelNodes(community) NonBasalNodes(community)

FractionBasalNodes(community) FractionIntermediateNodes(community) FractionTopLevelNodes(community) FractionIsolatedNodes(community) FractionNonBasalNodes(community) FractionConnectedNodes(community) FractionNonTopLevelNodes(community)

Value

Either a logical vector of length NumberOfNodes or a vector of names.

Arguments

community

an object of class Community.

Author

Lawrence Hudson

Details

Each node in a community is defined as:

isolatedNo resources or consumers, other than possibly itself
basalNo resources and one or more consumers
top-levelOne or more resources and no consumers, other than possibly itself
intermediateNodes not fitting any of the above categories

These definitions allow the following additional definitions:

connectedbasal, intermediate or top-level
non-basalisolated, intermediate or top-level
non-top-levelisolated, basal or intermediate

For each of the above seven definitions, `X', there are three functions: IsX, X and FractionX. The first returns a vector of logical of length NumberOfNodes; values are TRUE for nodes that fit the definition of `X'. The second returns the names of nodes for which IsX returns TRUE. The third returns the proportion of nodes in the community that fit the definition of `X'.

See Also

NumberOfNodes, Cannibals, IsCannibal, NumberOfTrophicLinks, PredationMatrix, Degree, InDegree, OutDegree, ResourcesByNode, ConsumersByNode, ResourcesOfNodes, ConsumersOfNodes

Examples

Run this code
data(TL84)

# Assemble a table of node connectivity. Only one of each of the following 
# four properties is TRUE for each node.
connectivity <- NPS(TL84, c('IsBasalNode', 'IsIsolatedNode', 
                            'IsIntermediateNode', 'IsTopLevelNode'))
connectivity

# Each row sums to 1, confirming that exactly one of the columns in each row 
# is TRUE.
all(1==rowSums(connectivity))

# These summations are 1
sum(FractionBasalNodes(TL84), 
    FractionIntermediateNodes(TL84), 
    FractionTopLevelNodes(TL84), 
    FractionIsolatedNodes(TL84))

sum(FractionConnectedNodes(TL84), 
    FractionIsolatedNodes(TL84))

sum(FractionBasalNodes(TL84), 
    FractionNonBasalNodes(TL84))

sum(FractionTopLevelNodes(TL84), 
    FractionNonTopLevelNodes(TL84))

Run the code above in your browser using DataLab