inst/doc/heritability.R

## ----setup--------------------------------------------------------------------
#| include: false

source("https://raw.githubusercontent.com/Flavjack/inti/master/pkgdown/favicon/docs.r")
knitr::opts_chunk$set(echo = TRUE)


## -----------------------------------------------------------------------------
#| echo: false

tibble(
  Standart = "$H^2=\\frac{\\sigma_g^2}{\\sigma_p^2}=\\frac{\\Delta G}{S}$",
  Cullis = "$H_{Cullis}^2=1-\\frac{\\overline{V}_{\\Delta..}^{^{BLUP}}}{2\\cdot\\sigma_g^2}$",
  Piepho = "$H_{Piepho}^2=\\frac{\\sigma_g^2}{\\sigma_g^2+\\frac{\\overline{V}_{\\Delta..}^{BLUE}}{2}}$"
  ) %>% 
  kable(caption = "Differentes heritability calculation")


## -----------------------------------------------------------------------------
library(inti)


## -----------------------------------------------------------------------------
dt <- inti::potato
hr <- H2cal(data = dt
          , trait = "stemdw"
          , gen.name = "geno"
          , rep.n = 5
          , fixed.model = ~ 0 + (1|bloque) + geno
          , random.model = ~ 1 + (1|bloque) + (1|geno)
          , emmeans = TRUE
          , plot_diag = FALSE
          , outliers.rm = TRUE
          )


## -----------------------------------------------------------------------------
hr$model %>% summary()


## -----------------------------------------------------------------------------
hr$tabsmr %>% kable(caption = "Variance component table")


## -----------------------------------------------------------------------------
hr$blues %>% kable(caption = "BLUEs")


## -----------------------------------------------------------------------------
hr$blups %>% kable(caption = "BLUPs")


## -----------------------------------------------------------------------------
hr$outliers$fixed %>% kable(caption = "Outliers fixed model")


## -----------------------------------------------------------------------------
hr$outliers$random %>% kable(caption = "Outliers random model")


## -----------------------------------------------------------------------------
#| echo: false
if(!file.exists("files/pkgs.bib")){write_bib(c(.packages()),'files/pkgs.bib')}

Try the inti package in your browser

Any scripts or data that you put into this service are public.

inti documentation built on Aug. 20, 2026, 5:08 p.m.