Methods for objects of type "MetaCommunity
".
1 2 3 4 5 6  MetaCommunity(Abundances, Weights = rep(1, ncol(Abundances)))
is.MetaCommunity(x)
## S3 method for class 'MetaCommunity'
summary(object, ...)
## S3 method for class 'MetaCommunity'
plot(x, ...)

Abundances 
A dataframe containing the number of observations (lines are species, columns are communities). The first column of the dataframe may contain the species names. 
Weights 
A vector of positive numbers equal to community weights or a dataframe containing a vector named 
x 
An object to be tested or plotted. 
object 
A 
... 
Additional arguments to be passed to the generic methods. 
In the entropart package, individuals of different "species" are counted in several "communities" which are agregated to define a "metacommunity".
This is a naming convention, which may correspond to plots in a forest inventory or any data organized the same way.
Alpha and beta entropies of communities are summed according to Weights
and the probability to find a species in the metacommunity is the weighted average of probabilities in communities.
The simplest way to import data is to organize it into two text files. The first file should contain abundance data: the first column named Species
for species names, and a column for each community.
Species  NameOfCommunity1  NameOfCommunity2 
NameOfSpecies1  1  5 
NameOfSpecies2  4  2 
...  ...  ...

The second file should contain the community weights and be organized as follows:
Communities  Weights 
NameOfCommunity1  3 
NameOfCommunity2  1

Files can be read and data imported by code such as:
1 2 3 4 
The number of individuals of the metacommunity $N
is not explicitly specified. It is calculated as the number of individuals of the lowerweighted community divided by its weight. For example, if the community with the smallest weight (5%) contains 100 individuals, the total number of individuals is set to 2000. The number of individuals per species of the metacommunity $Ns
is the product of $N
and $Ps
. In the special case where weights are proportional to the number of individuals of communities, the resulting number of individuals of the metacommunity is simply the sum of the number of individuals of communities. In other cases, the numbers of individuals of the metacommunity may not be integers. This does not appear to be a problem.
An object of class MetaCommunity is a list:
Nsi 
A matrix containing abundance data, species in line, communities in column. 
Ns 
A vector containing the number of individuals of each species. 
Ni 
A vector containing the number of individuals of each community. 
N 
The total number of individuals. 
Psi 
A matrix whose columns are the probability vectors of communities (each of them sums to 1). 
Wi 
A vector containing the normalized community weights (sum to 1). 
Ps 
A vector containing the probability vector of the metacommunity. 
Nspecies 
The number of species. 
Ncommunities 
The number of communities. 
SampleCoverage 
The sample coverage of the metacommunity. 
SampleCoverage.communities 
A vector containing the sample coverages of each community. 
is.MetaCommunity
returns TRUE
if the object is of class MetaCommunity
.
summary.MetaCommunity
returns a summary of the object's value.
plot.MetaCommunity
plots it.
Eric Marcon <Eric.Marcon@ecofog.gf>
1 2 3 4 5 6 7 8 9 10  # Use BCI data from vegan package
if (require(vegan, quietly = TRUE)) {
# Load BCI data (number of trees per species in each 1ha plot of a tropical forest)
data(BCI)
# BCI dataframe must be transposed (its lines are plots, not species)
BCI.df < as.data.frame(t(BCI))
# Create a metacommunity object from a matrix of abundances and a vector of weights
# (here, all plots have a weight equal to 1)
MC < MetaCommunity(BCI.df)
}

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.