This is a fast C++ backend for the PCMBase R-package.


The package needs a C++ 11 compiler and Rcpp to be installed in you R-environment. Once this is done, you can install the most recent version of the package from github:


If you experience problems installing the package from github, you may try installing a possibly older version from CRAN:


Once the package is installed, use the function BenchmarkRvsCpp to evaluate the gain in speed of the likelihood calculation on your machine, relative to the R implementation:

For further examples, read the Getting started guide and the reference available on the package homepage.

Citing PCMBase

To give credit to the PCMBase package in a publication, please cite the following articles:

Mitov, V., & Stadler, T. (2018). Parallel likelihood calculation for phylogenetic comparative models: The SPLITT C++ library. Methods in Ecology and Evolution, 2041–210X.13136.

Mitov, V., Bartoszek, K., Asimomitis, G., & Stadler, T. (2019). Fast likelihood calculation for multivariate Gaussian phylogenetic models with shifts. Theor. Popul. Biol.

Used 3rd party libraries

The PCMBaseCpp R-package uses the following R-packages and C++ libraries:

  • For tree processing in C++: The SPLITT library (Mitov and Stadler 2018);
  • For data processing in R: data.table v1.12.8 (Dowle and Srinivasan 2019);
  • For algebraic manipulation: The Armadillo C++ template library (Sanderson and Curtin 2016) and its port to R RcppArmadillo v0.9.700.2.0 (Eddelbuettel et al. 2019);
  • For unit-testing: testthat v2.1.1 (Wickham 2019), covr v3.2.1 (Hester 2018);
  • For documentation and web-site generation: roxygen2 v6.1.1 (Wickham, Danenberg, and Eugster 2018), pkgdown v1.3.0 (Wickham and Hesselberth 2018);


Dowle, Matt, and Arun Srinivasan. 2019. Data.table: Extension of ‘Data.frame‘.

Eddelbuettel, Dirk, Romain Francois, Doug Bates, and Binxiang Ni. 2019. RcppArmadillo: ’Rcpp’ Integration for the ’Armadillo’ Templated Linear Algebra Library.

Hester, Jim. 2018. Covr: Test Coverage for Packages.

Mitov, Venelin, and Tanja Stadler. 2018. “Parallel likelihood calculation for phylogenetic comparative models: The SPLITT C++ library.” Methods in Ecology and Evolution, December, 2041–210X.13136.

Sanderson, Conrad, and Ryan Curtin. 2016. “Armadillo: a template-based C++ library for linear algebra.” Journal of Open Source Software 1 (2).

Wickham, Hadley. 2019. Testthat: Unit Testing for R.

Wickham, Hadley, Peter Danenberg, and Manuel Eugster. 2018. Roxygen2: In-Line Documentation for R.

Wickham, Hadley, and Jay Hesselberth. 2018. Pkgdown: Make Static Html Documentation for a Package.