Package: prepR4pcm 1.0.0

Shinichi Nakagawa

prepR4pcm: Prepare Data and Trees for Phylogenetic Comparative Methods

Reconcile species names across datasets and phylogenetic trees for comparative biology workflows. Identifies mismatches due to formatting differences, taxonomic synonymy, and spelling errors. Produces detailed reports documenting how each name was resolved, which taxonomic authority was used, and what remains unresolved. Supports exact matching, name normalisation, synonym resolution via local taxonomic databases, and fuzzy matching for likely typos. Detects taxonomic splits and lumps. For methodological context, see Nakagawa et al. (2026) <doi:10.32942/X2468Z>.

Authors:Shinichi Nakagawa [aut, cre, cph], Santiago Ortega [aut], Ayumi Mizuno [aut], Eduardo S.A. Santos [aut], Malgorzata Lagisz [aut], Bhavya Jain [aut], Jimuel Jr Celeste [aut], Sergio Poo Hernandez [aut]

prepR4pcm_1.0.0.tar.gz
prepR4pcm_1.0.0.tar.gz(r-4.7-any)prepR4pcm_1.0.0.tar.gz(r-4.6-any)
prepR4pcm_1.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
prepR4pcm/json (API)

# Install 'prepR4pcm' in R:
install.packages('prepR4pcm', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/itchyshin/prepr4pcm/issues

Pkgdown/docs site:https://itchyshin.github.io

Datasets:

On CRAN:

Conda:

3.76 score 19 scripts 31 exports 15 dependencies

Last updated from:b78fe29add. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK260
source / vignettesOK331
linux-release-x86_64OK270
wasm-releaseOK187

Exports:pr_cite_treepr_date_treepr_extract_tipspr_get_treepr_get_tree_statuspr_normalize_namespr_phylo_corpr_tree_cache_clearpr_tree_cache_dirpr_tree_cache_statuspr_tree_comparereconcile_applyreconcile_augmentreconcile_crosswalkreconcile_datareconcile_diffreconcile_exportreconcile_mappingreconcile_mergereconcile_multireconcile_overridereconcile_override_batchreconcile_plotreconcile_reportreconcile_reviewreconcile_splits_lumpsreconcile_suggestreconcile_summaryreconcile_to_treesreconcile_treereconcile_trees

Dependencies:apeclidigestgluelatticelifecyclemagrittrnlmepillarpkgconfigRcpprlangtibbleutf8vctrs

Assembling mammal trait databases for phylogenetic comparative models
Setup | Load the example sources | Step 1: Compare the source tables | Step 2: Standardise the sources | Step 3: Reconcile species names with the tree | Step 4: Add manual corrections | Step 5: Collapse to one row per species | Step 6: Align the database and the tree | Final database ready for model fitting | References

Last update: 2026-06-25
Started: 2026-06-25

Comparing tree backends — when do they agree?
Setup | The recipe | What actually works (status table) | Branch lengths and time-calibration | Where are the VertLife trees? | Note on tip labels before comparing | What to do with the result | When the backends return the same species set and similar topology (Jaccard ≈ 1, RF small) | When tip sets differ (Jaccard < 1) | When topologies disagree (RF large) | When branch-length correlation is low | Caching the comparisons | What pr_tree_compare() doesn't do (yet) | See also

Last update: 2026-06-25
Started: 2026-06-25

From Raw Data to PCM: A Complete Bird Trait Workflow
Setup | Part I: Core Workflow | Step 1: Load data and tree | Step 2: Reconcile data against the tree | Step 3: Produce aligned objects | Step 4: Run a comparative analysis | Phylogenetic generalised least squares (PGLS) | Phylogenetic generalised linear mixed model (PGLMM) | Part II: Advanced Topics | Reconciling two datasets | Multi-row species | Asymmetric datasets | Using a taxonomy crosswalk | Reconciling against multiple trees | Fuzzy matching for typos | Tree augmentation for missing species | Exporting to files | HTML reports | Key points | Data sources | References

Last update: 2026-06-25
Started: 2026-06-25

From species names to a phylogenetic posterior — prepR4pcm + pigauto
What we'll build | Step 1 — Retrieve a posterior of trees | Step 2 — Reconcile the data to the posterior | Step 3 — Format citations (do this before you submit) | Step 4 — Hand the posterior to pigauto | Choosing a backend | What's not in this pipeline | See also

Last update: 2026-06-25
Started: 2026-06-25

Getting Started with prepR4pcm
The problem | Installation | Example 1: Reconcile a dataset against a tree | Inspect the result | Apply manual overrides | Produce aligned objects | Example 2: Reconcile two datasets | Understanding match types | Example 3: Using a taxonomic authority | Example 4: Pre-built overrides | Example 5: Multiple datasets against one tree | Key design principles | Typical workflow | References

Last update: 2026-06-25
Started: 2026-06-25

Phylogenetic meta-analysis with rotl + prepR4pcm
A worked example: thermal-tolerance plasticity across animal classes | Setup | Step 1-3: topology -> bifurcating -> Grafen branches, in one call | The manual pipeline (without prepR4pcm) | The same in one call (with prepR4pcm) | Confirm the two pipelines produce the same tree | Step 4: phylogenetic correlation matrix | Step 5: fit the meta-analysis with metafor | Manual tree grafting when Open Tree of Life doesn't have a species | Why Grafen (and not DateLife / a time-calibrated tree)? | What this vignette deliberately doesn't cover | See also

Last update: 2026-06-25
Started: 2026-06-25

Readme and manuals

Help Manual

Help pageTopics
AVONET morphological trait data (subset)avonet_subset
BirdLife-BirdTree taxonomy crosswalkcrosswalk_birdlife_birdtree
Plumage lightness data (subset)delhey_subset
Amniote-style mammal life-history samplemammal_amniote_example
PanTHERIA-style mammal life-history samplemammal_pantheria_example
TetrapodTraits-style mammal samplemammal_tetrapodtraits_example
Mammal phylogenetic tree (example)mammal_tree_example
Nest trait data (subset)nesttrait_subset
Format the citations for a tree resultpr_cite_tree
Time-calibrate a topology using the DateLife chronogram databasepr_date_tree
Extract tip labels from a phylogenetic treepr_extract_tips
Retrieve a candidate phylogeny for a species listpr_get_tree
Report the install status of every 'pr_get_tree()' backendpr_get_tree_status
Normalise scientific names to a canonical formpr_normalize_names
Phylogenetic correlation matrix from a treepr_phylo_cor
Clear the local tree-retrieval cachepr_tree_cache_clear
Get or set the local tree-retrieval cache directorypr_tree_cache_dir
Show the contents of the local tree-retrieval cachepr_tree_cache_status
Compare two or more phylogenetic treespr_tree_compare
Apply a reconciliation to produce an aligned data-tree pairreconcile_apply
Graft missing species onto a phylogenetic tree (genus-level placement)reconcile_augment
Convert a published taxonomy crosswalk into an overrides tablereconcile_crosswalk
Reconcile species names between two datasetsreconcile_data
Diff two reconciliations to see what changedreconcile_diff
Write an aligned dataset, tree, and mapping table to diskreconcile_export
Extract the per-name mapping table from a reconciliationreconcile_mapping
Merge two reconciled datasetsreconcile_merge
Reconcile several datasets against one phylogenetic treereconcile_multi
Manually override a single name in a reconciliationreconcile_override
Apply many manual corrections to a reconciliation at oncereconcile_override_batch
Plot the match composition of a reconciliationreconcile_plot
Write a self-contained HTML reconciliation reportreconcile_report
Interactively review reconciliation matchesreconcile_review
Flag taxonomic splits and lumps in a reconciliationreconcile_splits_lumps
Suggest near-miss matches for unresolved speciesreconcile_suggest
Print a reconciliation summary to the consolereconcile_summary
Reconcile one dataset against multiple phylogenetic treesreconcile_to_trees
Reconcile species names between a dataset and a phylogenetic treereconcile_tree
Reconcile tip labels between two phylogenetic treesreconcile_trees
Clements 2025 phylogenetic tree (subset)tree_clements25
Jetz (2012) phylogenetic tree (subset)tree_jetz