comparative analyses of phylogenetics and evolution in R

The caper package provides a set of tools for conducting phylogenetic comparative analyses in R. The main methods are phylogenetic independent contrasts and phylogenetic generalised least squares methods but the package also provides tools for calculating phylogenetic diversity, examining phylogenetic imbalance and for simulating phylogenies.

Installing caper

Official versions

20/02/12 Version 0.5 of caper is now on CRAN, includes bug fixes and compatibility with R >= 2.14. Thanks for bug reports in this update to: Tom Kraft, Mike Steiper, Sarah Dryhurst, Kirsty McGregor and Lynsey McInnes.

Official 'released' versions of caper for Windows, Mac OS X and Linux are available from the Comprehensive R Archive Network ( and can be installed from within R using the following code:


The table below shows the list of CRAN releases of caper along with the R versions for which binary builds should be available.

Version Date R version >=
0.5 (code revision 92) 21/02/12 2.14
0.4 (code revision 68) 04/06/11 2.13

Development versions

The package is developed and maintained on the R-Forge website, from which the most recent version of the package can be downloaded or installed. Note that this will include all recent changes and may contain code still in development. Binary packages for Windows and Mac OS X and the most recent version of the source code can be found here.

Note that R-Forge only maintains binary packages for the most recent release of R. If you are using the most recent version, then the following code should install the most recent version of caper:

install.packages('caper', repos='')

If you are using an older version of R, then a binary version of caper is unlikely to be available. Because caper currently only uses pure R code (and not any Fortan or C), it may be possible to install caper on older versions of R using the following code:

install.packages('caper', repos='', type='source', dependencies=TRUE)

The caper package requires the packages 'ape', 'MASS' and 'mvtnorm'.

Using caper

In addition to the standard R documentation pages for functions and datasets (see help(package='caper'), the caper package contains two vignettes. The first, the 'caper' vignette, contains a short introduction to phylogenetic comparative methods and step by step guidance on the use of the various functions:


The second vignette contains a set of comparisons of analyses using caper to the same analyses in other software implementations:


Bugs and support requests can be submitted through the project tracker pages. The project development page for the package can be found here. The package is maintained by David Orme.