Learn R Programming

cheddar (version 0.1-626)

Community: Community

Description

Creates and returns a new object that represents an ecological community.

Usage

Community(nodes, properties, trophic.links = NULL)
## S3 method for class 'Community':
print(x, \dots) 
## S3 method for class 'Community':
plot(x, \dots) 
## S3 method for class 'Community':
summary(object, \dots)

Arguments

nodes
a data.frame containing one row per node. A column called `node' is mandatory and must contain node names. An error is raised if any node names are duplicated. Whitespace is stripped from the beginning and end of node names. If
properties
a list of properties the community as a whole. All elements must be named and must be of length one.
trophic.links
NULL or a data.frame or matrix of trophic link properties. If not NULL, columns called `resource' and `consumer' must be given and these should contain node names. An error is raised if an
x
an object of class Community.
object
an object of class Community.
...
further arguments passed to other methods.

Value

  • A new object of class Community.

Details

The most convenient way to import community data in to Cheddar is to put data in to CSV files and use the LoadCommunity function.

Many of Cheddar's plot and analysis functions make use of the `category' node property by default, following previously-used metabolic groupings (Yodzis and Innes, 1992). The column nodes$category is optional but, if given, it should contain one of `producer', `invertebrate', `vert.ecto', `vert.endo' or should be an empty string.

Community supports standard generic functions plot, print, and summary.

References

Yodzis, P. and Innes, S. (1992) Body size and resource-consumer dynamics. The American Naturalist 139, 1151--1175.

See Also

CPS, NPS, TLPS, LoadCommunity SaveCommunity

Examples

Run this code
data(TL84)
TL84

# Node properties
NPS(TL84)

# Trophic-link properties
TLPS(TL84)

# Eyeball the data
plot(TL84)

# A different plot function
PlotWebByLevel(TL84)

# Construct a new community.
# TL84.new is an exact copy of TL84
TL84.new <- Community(properties=CPS(TL84), 
                      nodes=NPS(TL84),
                      trophic.links=TLPS(TL84))
identical(TL84, TL84.new)

# A copy of TL84 without trophic links
TL84.no.links <- Community(properties=CPS(TL84), 
                           nodes=NPS(TL84))
NumberOfTrophicLinks(TL84.no.links)

# A community with 10 species and no properties
test <- Community(nodes=data.frame(node=paste('Species', 1:10)), 
                  properties=list(title='Test community'))
test
NPS(test)

Run the code above in your browser using DataLab