MyNixOS website logo
Description

Heritability Estimation from Mixed Models.

Reporting heritability estimates is an important to quantitative genetics studies and breeding experiments. Here we provide functions to calculate various broad-sense heritabilities from 'asreml' and 'lme4' model objects. All methods we have implemented in this package have extensively discussed in the article by Schmidt et al. (2019) <doi:10.1534/genetics.119.302134>.

heritable

Lifecycle:experimental CRANstatus Codecov testcoverage

heritable is to be the one-stop shop for heritability calculations in R. Our goal is to implement existing methods for heritability to aid reproducibility and reporting of it’s calculations.heritable works with model outputs from asreml and lme4 and support the calculations of broad and narrow sense heritability of a variety of method for single environment breeding trials.

Installation

Note that this package is under active development. You can install the development version of heritable from GitHub with:

# install.packages("pak")
pak::pak("anu-aagi/heritable")

A simple demo

This is a basic example which shows you how to calculate broad-sense heritability for a single environment trial using asreml and lme4.

library(heritable)  

fit_asreml <- asreml::asreml(yield ~ rep,
    random = ~ gen + rep:block,
    data = agridat::john.alpha,
    trace = FALSE
  )

fit_lme4 <- lme4::lmer(yield ~ rep + (1|gen) + (1|rep:block),
                       data = agridat::john.alpha)

The H2() function refers to broad-sense heritability and by default, it will compute all the available heritability methods for you.

H2(fit_asreml, target = "gen")
#>    Cullis     Oakey    Piepho     Delta  Standard 
#> 0.8090841 0.8090841 0.8029760 0.8090841 0.8400648
H2(fit_lme4, target = "gen")
#>    Cullis     Oakey    Piepho     Delta  Standard 
#> 0.8091338 0.8091338 0.7966375 0.8091338 0.8400678

Alternatively, with the help of tidyverse functions, you can return all the measures for different models as a tibble.

library(tidyverse)
tibble(model = list(fit_lme4, fit_asreml)) |> 
  mutate(H2 = map(model, ~H2(.x, target = "gen"))) |> 
  unnest_wider(H2)
#> # A tibble: 2 × 6
#>   model     Cullis Oakey Piepho Delta Standard
#>   <list>     <dbl> <dbl>  <dbl> <dbl>    <dbl>
#> 1 <lmerMod>  0.809 0.809  0.797 0.809    0.840
#> 2 <asreml>   0.809 0.809  0.803 0.809    0.840

Support our work!

citation("heritable")
#> To cite package 'heritable' in publications use:
#> 
#>   Kar F, Tanaka E (2025). _heritable: R package for heritability
#>   calculations for plant breeding trials_. R package version 0.0.9000,
#>   <https://github.com/anu-aagi/heritable>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {heritable: R package for heritability calculations for plant breeding trials},
#>     author = {Fonti Kar and Emi Tanaka},
#>     year = {2025},
#>     note = {R package version 0.0.9000},
#>     url = {https://github.com/anu-aagi/heritable},
#>   }

Found a bug? Want to contribute?

We welcome feedback and contributions of all shapes and sizes! Take a look at our existing backlog and add to a relevant discussion or lodge a new issue.

Metadata

Version

0.1.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows