Analysis of the 'Elements of Metacommunity Structure'

Functions to analyze coherence, boundary clumping, and turnover following the pattern-based metacommunity analysis of Leibold and Mikkelson 2002 . The package also includes functions to visualize ecological networks, and to calculate modularity as a replacement to boundary clumping.

Build Status Downloads codecov Build status


Either install from CRAN, or directly from GitHub using the code below. Note that GitHub is the development version of the package, which may or may not differ from what's on CRAN.

# From CRAN
# From GitHub
# install.packages("devtools")


 'metacom' provides functions for the analysis of the elements of
 metacommunity structure (coherence, boundary clumping, &
 turnover), following the pattern-based metacommunity framework of
 Leibold & Mikkelson 2002 and Presley et al. 2010. This package is
 designed to allow the user to distinguish between several
 idealized patterns of metacommunity structure (Presley et al.
 2010) utilizing any number of null model algorithms for the
 randomization procedure. However, these metrics can also be used
 in isolation, and without ordination via reciprocal averaging, and
 instead, ordering along some biological gradient.

Definition of a metacommunity:

A metacommunity is a set of sites (e.g. plants in plant-pollinator
 networks) associated through interactions (e.g. insect species
 (columns) interact with plant species (rows) in plant-pollinator
 networks). The pattern-based metacommunity concept, proposed by
 Leibold & Mikkelson 2002 and expounded on by Presley et al. 2010,
 allows for the evaluation of metacommunity structure by using
 randomization techniques to discern between 10 patterns of
 metacommunity structure. This is performed by ordinating
 site-by-species interaction matrices and calculating three
 metrics; coherence, boundary clumping & turnover.

The Elements of Metacommunity Structure Framework:

 The metacom package calculates these three metrics; coherence is
 calculated using the function Coherence(), boundary clumping with
 BoundaryClump(), and turnover (from either species or range
 perspective) using the Turnover() function. These functions are
 consolidated in the metacommunity() function, which can be used to
 calculate all three metrics. In order to interpret the output of
 these functions, it will be helpful to read Leibold & Mikkelson
 2002 and Presley et al. 2010, but to also read Ulrich and Gotelli
 2013, as this paper outlines the difficulty seemingly inherent
 with investigating community structure. Also, these functions do
 not have to be used strictly in the Leibold and Mikkelson 2002

A cautionary note:

I caution the user to be aware that the creation of null matrices
 can be performed to allow (or not allow) sites to be empty, or
 species to not exist at any site (i.e. column sums and/or row sums
 are allowed to be zero). This is controlled by the logical
 argument 'allow.empty' in the Metacommunity(), NullMaker(),
 Coherence(), and Turnover() functions. Restricting nulls to not
 allow empty rows or columns may be biologically realistic, but it
 also reduces the number of unique null matrices that can be built,
 which will impact computation time, making it infeasible or
 impossible in some situations. These situations occur when you
 have a very sparse interaction matrix, and is also influenced by
 null model algorithm ('method') that you choose.

The 'metacom' package is partially adapted from previous Matlab code written by Christopher Higgins (available here) and relies on many functions in the 'vegan' package (Oksanen et al. 2012).


metacom 1.5.1

  • Do not ordinate the null matrices. This won't affect the results from fixed-fixed null.

metacom 1.5.0

  • Implemented the original null model for turnover as outlined in Leibold and Mikkelson 2002. Previous versions used a more traditional null model approach than shifting species filled ranges across sites as a block. There are pros and cons to both methods, but now the user has a choice.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.5.1 by Tad Dallas, 7 months ago

Report a bug at

Browse source code at

Authors: Tad Dallas [aut, cre] , Tom Pulliam [ctb]

Documentation:   PDF Manual  

Task views: Analysis of Ecological and Environmental Data

GPL-2 license

Depends on vegan

Suggests testthat

Imported by inpdfr.

See at CRAN