rtrees: Deriving Phylogenies from Synthesis Trees

Provides tools to derive species-level phylogenies from large synthesis mega-trees for a wide range of taxonomic groups, including plants, birds, mammals, amphibians, reptiles, fish, bees, butterflies, and sharks. When a queried species is absent from the mega-tree, it is grafted onto the tree using one of two placement strategies: attachment at the basal node of the most closely related genus or family ('at_basal_node'), or random attachment below that basal node with probability proportional to branch length ('random_below_basal'). See Li (2023) <doi:10.1111/ecog.06643> for details. Multiple species from a genus not represented in the mega-tree are placed as a polytomy to preserve clade coherence. The package interfaces with the 'megatrees' data package, which bundles or downloads on demand curated mega-trees. Users can also provide their own mega-trees.

Version: 2.0.2
Depends: R (≥ 3.5.0)
Imports: ape, tidytree, dplyr, tibble, utils, castor, furrr, future, megatrees (≥ 0.1.3), fastmatch, data.table, Rcpp
LinkingTo: Rcpp
Suggests: knitr, rmarkdown, testthat, piggyback, R.rsp, ggplot2
Published: 2026-06-11
DOI: 10.32614/CRAN.package.rtrees (may not be active yet)
Author: Daijiang Li ORCID iD [aut, cre]
Maintainer: Daijiang Li <daijianglee at gmail.com>
License: GPL-3
URL: https://daijiang.github.io/rtrees/
NeedsCompilation: yes
Citation: rtrees citation info
Materials: README
CRAN checks: rtrees results

Documentation:

Reference manual: rtrees.html , rtrees.pdf
Vignettes: Speed comparisons (source, R code)
Non-monophyletic-groups (source)
Simple_example (source)
grafting_scenarios (source)

Downloads:

Package source: rtrees_2.0.2.tar.gz
Windows binaries: r-devel: not available, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): not available, r-oldrel (arm64): rtrees_2.0.2.tgz, r-release (x86_64): rtrees_2.0.2.tgz, r-oldrel (x86_64): rtrees_2.0.2.tgz

Linking:

Please use the canonical form https://CRAN.R-project.org/package=rtrees to link to this page.