R Observatory
Search

Fill in Missing Species Traits Using a Phylogenetic Tree

install.packages("pigauto")
CRAN 30-day downloads, method
361+11.4% up on the 30 days before, the better direction
Test coverage, method
67%of lines run by tests

Imputes missing species trait data for comparative analyses by combining three sources of information: phylogenetic similarity (closely related species share similar traits), cross-trait correlations (observed traits inform missing ones), and optional environmental covariates (climate, habitat, ...

Full description

Imputes missing species trait data for comparative analyses by combining three sources of information: phylogenetic similarity (closely related species share similar traits), cross-trait correlations (observed traits inform missing ones), and optional environmental covariates (climate, habitat, geography). Handles continuous measurements, counts, binary variables, ordered categories, unordered categories, bounded proportions, zero-inflated counts, and compositional multi-proportion data in a single call. The default method is a phylogenetic baseline calibrated on held-out data; an optional graph neural network correction, which is needed to use covariates, is blended in through a per-trait gate that retains a baseline fallback. Provides conformal prediction intervals for continuous, count, ordinal, and proportion traits and an experimental analysis-aware multiple-imputation workflow for one missing continuous covariate in Gaussian linear, binomial-logit, and Gaussian random-intercept models, with Rubin pooling limited to fixed effects. Stochastic graph-network and posterior-tree completions are prediction diagnostics rather than validated inferential imputations. Bundled datasets include 300-species and 9,993-species bird-trait subsets with matching example phylogenetic trees. Rubin (1987, ISBN:978-0-471-08705-2); Vovk et al. (2005, ISBN:978-0-387-25061-8); Nakagawa and de Villemereuil (2019) <doi:10.1093/sysbio/syy089>.

Maintainer
Shinichi Nakagawa
Latest release
18 Oct 2026
First release
30 Jul 2026

Compare with another package

More details
Releases
2
Needs compilation
No
Needs R
>= 4.1
Config/roxygen2/version
8.0.0
Config/testthat/edition
3
LazyData
true
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' preferred citation:

citation("pigauto")
APA
Nakagawa, S. (2026). pigauto: Fill in Missing Species Traits Using a Phylogenetic Tree (Version 0.11.0) [Computer software]. https://doi.org/10.32614/CRAN.package.pigauto
About

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for pigauto version 0.11.0 [Data set]. HJJB, LLC. Data release v2026-10-29. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-29, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    0.11.0
    Time taken
    495 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    0.11.0
    Time taken
    333 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    0.11.0
    Time taken
    336 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    0.11.0
    Time taken
    332 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    459 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    0.11.0
    Time taken
    139 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    545 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    602 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    466 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    473 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    0.11.0
    Time taken
    119 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    656 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    0.11.0
    Time taken
    434 s
  • 13 OK

Over time

No change since 17 Oct 2026

As a list (5)
ChangedWorst statusOKNotesWarningsErrors
17 Oct 2026OK13000
1 Oct 2026Warning12010
5 Aug 2026OK12000
1 Aug 2026Note9100
31 Jul 2026OK7000

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
370+9.8% up on the 30 days before, the better directionIt is the sum of 3 channels: CRAN, r2u and autoCRAN.

CRAN rank

10,230 of 26,553

CRAN

361 downloads in the last 30 days

Rank
10,230 of 26,553
Change
+11.4% up on the 30 days before, the better direction

It is in the total. Take it out

r2u

4 downloads in the last 30 days

Rank
10,337 of 30,526
Change
−50% down on the 30 days before, the worse direction

It is in the total. Take it out

autoCRAN

5 downloads in the last 30 days

Rank
11,553 of 29,233
Change
no change on the 30 days before

It is in the total. Take it out

Over time

Compare downloads

Needs
10
Dependent packages
0
Suggested by
0
Needs (10)
Installing it adds
32 packages, 21.3 MB of source
Of those, need compilation
17
Optional extras (19)
Functions
331
Public exports
33
Lines of R code
26,074
Median complexity
5
Functions (331)
Size and composition

Lines by kind (54,202)

KindLinesShare
R code26,07448%
Tests21,19139%
Documentation4,9139%
Guides2,0244%

Lines by language

LanguageLinesShare
R46,97887%
Rd4,9139%
Vignettes2,0244%
Other2870.5%

Languages are counted from file extensions.

Files
237
R functions
331
Object systems
S3: 23 methods
Complexity
Median
5
Mean
9.73
Highest
151
Median lines per function
25
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
331
Calls
393
Unconnected
42
Groups
8
Growth (2 releases)
Total lines by release
35,385 on 30 Jul 202654,202 on 18 Oct 2026
Release changes

Coverage was measured, but at least one test failed during the run.

Lines run by tests
67.2%
Expressions run by tests
67.7%
Test cases
825
Exports named in tests
100%
Coverage by file (47)
Coverage run
Lines counted
12,392
Lines the tests ran
8,328
Tests passed
No
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat, tinytest
Test cases
825
Lines of tests
21,191
Test lines per line of code
0.81
Exports documented
100%
Arguments documented
99%
Return value documented
100%
Help pages with examples
79.2%
Examples run in checks
36.8%
Guides (6)
Other documentation
README
Yes, 991 words
Release notes file
Yes
Help pages
48
Lines of documentation
4,913

8 datasets, 6 can be loaded by name

DatasetSizeColumns
avonet300AVONET morphological and ecological trait data for 300 bird species300 × 8Species_Key, Mass, Beak.Length_Culmen, Tarsus.Length, Wing.Length, Trophic.Level and 2 more
avonet_fullFull AVONET morphological and ecological trait data for 9,993 bird species9,993 × 8Species_Key, Mass, Beak.Length_Culmen, Tarsus.Length, Wing.Length, Trophic.Level and 2 more
ctmax_simSimulated multi-observation-per-species CTmax data1,464 × 3species, acclim_temp, CTmax
legacy_fit_v091length 26
novice_traits8 × 4species, mass, clutch, threat_status
tree300Example bird phylogeny for the 300 species in `avonet300`length 6
tree_fullExample bird phylogeny for the species in `avonet_full`length 6
trees30050 posterior phylogenies for the 300 species in `avonet300`length 50

itchyshin / pigauto on github.com

Stars
3
Forks
0
Open issues
1
Last commit
28 Oct 2026
Activity
Commits
1,255
Open pull requests
1
Tagged releases
6
Latest tagged release
v0.10.0, 11 Jul 2026
Issues closed in
3 days (median)
Pull requests closed in
0 days (median)
Pull requests merged
98%
Created
10 May 2025
Licence file reads as
–
Development practices (9)
KindFound
Continuous integrationGitHub Actions, R CMD check workflow
The R CMD check workflow runs on Linux and macOS, and on R-devel
Docs sourcepkgdown
GitHub Pages site last deployed 2026-10-20
The repository has a site deploy workflow
Reproducibility and dev environmentdata-raw/, Dev Container
CRAN release processcran-comments.md
Lint, format, editorRStudio project

Method, repository practices

Across itchyshin

Claude Codeat least 603 crediting itClaude CodeFirst seen 6 Apr 2026at least 603 crediting it
Claude Sonnet 4.6Claude Sonnet 4.611 Apr 2026 to 15 Apr 2026At least 34 commits
Claude Opus 4.61MClaude Opus 4.61M context window14 Apr 2026 to 16 Apr 2026At least 49 commits
Claude Opus 4.6Claude Opus 4.69 Apr 2026 to 15 Apr 2026At least 17 commits
Cursorat least 15 crediting itCursorFirst seen 8 Aug 2026at least 15 crediting it

Tools

ToolFirst seenFoundCommits crediting it
Claude Code6 Apr 2026Seen in the repository.claude.claude/agentsCLAUDE.mdNamed in .Rbuildignore.claudeCLAUDE.mdNamed in .gitignore.claudePull request it wrote: opened by a project member603 at least
Cursor8 Aug 2026Pull request it wrote: opened by a project member15 at least
  • Seen in the repository
  • Named in .Rbuildignore
  • Named in .gitignore
  • Pull request

Shared conventions

AGENTS.md

Models

ModelContext windowCommitsFirst commitLast commitCredit lines of
Claude Sonnet 4.634 at least11 Apr 202615 Apr 2026Claude Code
Claude Opus 4.61M49 at least14 Apr 202616 Apr 2026Claude Code
Claude Opus 4.617 at least9 Apr 202615 Apr 2026Claude Code

Across itchyshin

R releases
  • On CRAN
  • Release
VersionReleasedR
0.11.0 current18 Oct 20264.6.1
0.10.030 Jul 20264.6.1
Release notes (0.11.0)

Example portability

The plot.pigauto_fit() example now follows the package default and fits without

the optional GNN runtime, while still demonstrating the gate and conformal plots.

The compare_methods() example now checks that torch and its Lantern runtime

can create a tensor before fitting the GNN. It reports a skip when the runtime

is unavailable, while compare_methods() keeps its documented

gnn = TRUE default.

BirdTree example and retrieval guidance

The README and tutorials now identify tree300 as a posterior sample tree and

describe how to obtain and cite BirdTree trees. The README clarifies that

BirdTree distributes Newick files and read_tree() also accepts NEXUS files.

The installed NOTICE

distinguishes the optional megatrees package licence from rights to the

underlying data, and the bundled trees300 help documents its Ericson/Hackett

mixture. The retired simulation study remains in the repository's history but

is excluded from the public site, sitemap, and search index.

The package description no longer makes an unqualified claim that the current

release has been tested at 10,000 species. The historical scaling note below

now distinguishes the completed 9,993-species missingness study from the

v0.9.0 timing run, which stopped at 5,000 tips.

New defaults: discrete traits get their own λ; safety gate and floor off

Two defaults change, and results change for anyone using the defaults.

First, binary, ordinal and categorical traits now get their own Pagel's

lambda in the baseline (on the liability scale; categorical traits through

their one-vs-rest fits). Before, categorical traits were held at lambda = 1 and

binary and ordinal traits at 1, or at the joint lambda shared with the

continuous traits on the "exact" route. The new argument

discrete_lambda = c("estimate", "fixed_1") (on impute(), fit_pigauto()

and fit_baseline(), and through ... on multi_impute() and

multi_impute_trees()) defaults to "estimate" and is recorded in the fit's

model_config. Binary and ordinal lambdas appear in $lambda_per_trait; the

categorical one-vs-rest lambdas do not. The zero-inflated-count gate column

also gets its own lambda.

Second, safety_floor and phylo_signal_gate now default to FALSE in

impute() and fit_pigauto(). With lambda estimated, the gate and the floor

did not improve accuracy in any setting tested: at Pagel's lambda of 0 to 0.1

the old defaults were worse than predicting the mean (continuous zRMSE 1.01

against 0.89 to 0.91 with them off), and on the BIEN plant data (4,745

species) that the floor was built for, turning them off changed error by

-0.002 (SE 0.001). Fits

are also 3 to 6 times faster at n = 1,000.

To restore the previous behaviour, pass

discrete_lambda = "fixed_1", safety_floor = TRUE, phylo_signal_gate = TRUE.

Evidence (docs/dev-log/discrete-lambda/README.md; simulated Brownian-motion

and OU data, n = 100 to 1,000, plus AVONET300 and BIEN): estimating discrete

lambda alone added about 0.01 to 0.04 discrete accuracy at Pagel's lambda of 0.3 or

below; together with the gate and floor off the gain was 0.04 to 0.12, and on

the four-arm study's datasets binary and categorical accuracy matched or beat

BACE's. Costs: with lambda near 1 and n of 1,000 or more, accuracy -0.002 to

-0.005 and Brier score +0.010 to +0.016; on AVONET300's two categorical

traits, Brier +0.014 to +0.020 with accuracy unchanged or better. Ordinal

accuracy still trails BACE's at Pagel's lambda of 0.3 (0.38 against 0.44 at

n = 300).

Documentation: log_transform and traits that are already logged

?impute, ?multi_impute, ?multi_impute_trees, ?preprocess_traits and the

getting-started vignette now say that the default log_transform = TRUE logs

every all-positive continuous trait, so traits that are already on a log scale

are logged twice. Set log_transform = FALSE for such data. In a real-data

check on PanTHERIA (4,027 species, four already-logged traits, posterior

draws), the default shifted Rubin-pooled regression slopes by up to 3.9

The notes are cut short here.