'R' Interface for 'Julia'-Backed Quantitative-Genetic Models

Provides an interface for quantitative-genetic models in 'R', backed by the 'HSquared.jl' engine for 'Julia'. Fits Gaussian pedigree animal models by restricted maximum likelihood, using average-information restricted maximum likelihood (AI-REML; Gilmour et al. (1995) ) for the univariate model. Returns heritability, variance components, breeding values, and covariance and correlation matrices for multivariate models. Formula and pedigree validation can run without 'Julia'. Model fitting requires a local 'Julia' and 'HSquared.jl'; use hs_control(engine = "validate") to preview the model contract without fitting. What you may report is listed on the package article 'Can I fit and report this?', not in validation_status(), which is a developer evidence table. Model-specific restrictions are documented in that article. Uncertainty intervals are not coverage-calibrated.


hsquared

Lifecycle: experimental R-CMD-check

R interface · Julia engine · a twin, not a port

How much is genetic?

Formula first. The engine returns heritability, variance components, and breeding values on the routes that are covered — experimental 0.9.0 release, not production. CRAN availability is tracked separately.

Get started Choose a model Fit a model

Before you report anything

Warning — experimental 0.9.0 release. Not production. CRAN availability is tracked separately. There are 7 R-public covered routes; fitting needs local Julia and an HSquared.jl checkout. Julia engine-covered ≠ R-public covered. Report point estimates only within a covered route. No interval is nominally coverage-calibrated; named univariate pedigree intervals are only classified as directional-conservative. See Can I fit and report this?.

Your first analysis

  1. 1. Get started
    Install or validate a first animal-model formula.
  2. 2. Choose a model
    Check the route scope before fitting.
  3. 3. Fit
    Run the smallest honest workflow.
  4. 4. Diagnose
    Read fit diagnostics before extracting results.
  5. 5. Report
    Use route-scoped point estimates only.

Start here

If you want to… Read this
check a formula without installing Julia Getting started (control = hs_control(engine = "validate"))
decide whether a number may go in a paper Can I fit and report this?
see the seven R-public covered routes Model status
set up the Julia engine Installation
look up a function Reference
understand evidence history without mistaking it for a release Progression & evidence

Quick start — no Julia required

This four-animal pedigree is a syntax demo, not a number for a paper.

library(hsquared)

ped <- data.frame(
  id   = c("sire", "dam", "off1", "off2"),
  sire = c(NA, NA, "sire", "sire"),
  dam  = c(NA, NA, "dam", "dam")
)
dat <- data.frame(
  id     = c("sire", "dam", "off1", "off2"),
  sex    = c("m", "f", "m", "f"),
  weight = c(42, 38, 40, 37)
)

hsquared(
  weight ~ sex + animal(1 | id, pedigree = ped),
  data = dat,
  control = hs_control(engine = "validate")
)

Fitting — requires the Julia engine

With a local Julia, JuliaCall, and an HSquared.jl checkout (see Installation):

fit <- hsquared(
  weight ~ sex + animal(1 | id, pedigree = ped),
  data = dat
)
summary(fit)

Report only what Can I fit and report this? allows for the route you ran.

Installation

# install.packages("remotes")
remotes::install_github("itchyshin/hsquared")

Fitting also needs Julia, JuliaCall, and a local HSquared.jl tree. HSquared is not in the Julia General registry — do not use Pkg.add("HSquared") by name.

install.packages("JuliaCall")

Clone or point at your HSquared.jl checkout per the getting-started guide.

Authors

Shinichi Nakagawa (ORCID 0000-0002-7765-5182, [email protected]), Yefeng Yang (ORCID 0000-0002-8610-4016), Szymon Drobniak (ORCID 0000-0001-8101-6247).

Twin

hsquared is the applied R interface. HSquared.jl is the sparse engine. A twin, not a port.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("hsquared")

0.9.0 by Shinichi Nakagawa, 5 hours ago


https://itchyshin.github.io/hsquared/, https://github.com/itchyshin/hsquared, https://github.com/itchyshin/HSquared.jl


Report a bug at https://github.com/itchyshin/hsquared/issues


Browse source code at https://github.com/cran/hsquared


Authors: Shinichi Nakagawa [aut, cre, cph] (ORCID: , Yefeng Yang [aut, cph] , Szymon Drobniak [aut, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ggplot2, lifecycle, Matrix, stats

Suggests enhancer, JuliaCall, knitr, lme4, nadiv, pedigreemm, rmarkdown, sommer, testthat, withr


See at CRAN