# install.packages("heritable")
library(heritable)What is heritability?
In genetics, heritability quantifies how much variation in a trait is due to genetic differences vs. environmental effects. It provides an indication of how evolvable traits are which is important for fields such as evolutionary ecology, quantitative genetics and breeding research.
The challenge
Recently, a number of statistical methods have been proposed for generalising heritability to account for factors such as unbalanced replication. These competing methods are important for accounting different sources of variation, but they have not been implemented in an accessible way.
To complicate matters further, its not common convention to openly report on how we calculate heritability. Rarely do we share our heritability code scripts either. This makes it difficult to reproduce each others calculations and objectively make interpretations across studies.
📦 Introducing {heritable}
heritable is an R package designed to compute a variety of heritability estimates from mixed model outputs. Our goal is to provide a centralised toolkit for heritability calculations. Currently, we have implemented six broad-sense heritability methods for single environment models. Our functions are compatible with mixed model objects from packages lme4 and asreml
You can download heritable from CRAN!
Alternatively, if you would like the latest developements you can download heritable directly from our Github repo
# remotes::install_github("anu-aagi/heritable")Heritability methods
We have implemented the following for broad-sense heritability:
- Cullis’ method
- Oakey’s method
- Piepho’s method
- Delta method
- Standard method
You can learn more about these on our package website
These methods come from mixed model theory and differ in how to obtain the necessary variance components for calculations. We recommend having a good read of Paul Schmidt’s and colleagues review paper to learn more about their derivation and nuances.
A quick demo
We’ll use the lettuce dataset included in the package to show you the workflow of the package
Fit a single environment model
Let’s fit a single environment model using lme4 and asreml, noting that the latter requires a license to run.
library(lme4)
fit_lme4 <- lmer(y ~ rep + (1|gen) + (1|rep), data = lettuce_phenotypes)library(asreml)Online License checked out Wed Jan 14 13:58:24 2026
fit_asreml <- asreml(
fixed = y ~ rep,
random = ~ gen,
data = lettuce_phenotypes,
trace = FALSE
)Calculate broad-sense heritability
By default, the wrapper H2() will compute all available estimates for you.
H2(fit_lme4, target = "gen") Cullis Oakey Piepho Delta Standard
0.7737572 0.7737572 0.7724131 0.7737572 0.7725492
H2(fit_asreml, target = "gen") Cullis Oakey Piepho Delta Standard
0.7737597 0.7737597 0.7725934 0.7737597 0.7738271
What’s next for {heritable} and contributing to the package
We have a few features in the pipeline including:
- Narrow-sense heritability calculations
- Confidence intervals for estimates
- Estimates for G x E models
- Expand compatibility with
glmmTMBand Bayesian modelsbrmsorrstan - Data visualiation of variance decomposition
We are always excited to receive feedback, hear new ideas and find ways to collaborate. Get in touch by submitting a Github issue at our repository!
Learn more
Check out Fonti’s Biometrics in the Bush Capital conference talk, where she soft launches heritable